Debian Bug report logs - #564774
python-numpy: savez() does _not_ compress

version graph

Package: python-numpy; Maintainer for python-numpy is Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>; Source for python-numpy is src:python-numpy.

Reported by: Michael Hanke <michael.hanke@gmail.com>

Date: Mon, 11 Jan 2010 21:18:02 UTC

Severity: normal

Tags: fixed-upstream

Found in version python-numpy/1:1.3.0-3

Fixed in version 1:1.6.1-1

Done: Sandro Tosi <morph@debian.org>

Bug is archived. No further changes may be made.

Forwarded to http://projects.scipy.org/numpy/ticket/1354

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#564774; Package python-numpy. (Mon, 11 Jan 2010 21:18:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Hanke <michael.hanke@gmail.com>:
New Bug report received and forwarded. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Mon, 11 Jan 2010 21:18:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Michael Hanke <michael.hanke@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: python-numpy: savez() does _not_ compress
Date: Mon, 11 Jan 2010 16:15:58 -0500
Package: python-numpy
Version: 1:1.3.0-3
Severity: normal

Hi,

the docs of the savez() function say:

| Save several arrays into a single, compressed file with extension ".npz"

However, that is not the case. Here is a short dump of an IPython
session to show it:

>>> import numpy as np
>>> np.savez('test.npz', N.ones((10000, 1000)))
>>> ll -h *.npz
-rw-r--r-- 1 michael michael 77M 2010-01-11 15:52 test.npz
>>> !gzip test.npz
>>> ll -h test*.gz
-rw-r--r-- 1 michael michael 114K 2010-01-11 15:52 test.npz.gz
                             ^^^^


If I want to load my "hand-compressed", renamed to have .npz extension,
file I get this (2 attempts):

In [1]: N.load('test.npz')
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)

/tmp/<ipython console> in <module>()

/usr/lib/python2.5/site-packages/numpy/lib/io.pyc in load(file, mmap_mode)
    199         except:
    200             raise IOError, \
--> 201                 "Failed to interpret file %s as a pickle" % repr(file)
    202 
    203 def save(file, arr):

IOError: Failed to interpret file 'test.npz' as a pickle


In [3]: import gzip

In [4]: N.load(gzip.open('test.npz'))
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)

/tmp/<ipython console> in <module>()

/usr/lib/python2.5/site-packages/numpy/lib/io.pyc in load(file, mmap_mode)
    188     fid.seek(-N,1) # back-up
    189     if magic.startswith(_ZIP_PREFIX):  # zip-file (assume .npz)
--> 190         return NpzFile(fid)
    191     elif magic == format.MAGIC_PREFIX: # .npy file
    192         if mmap_mode:

/usr/lib/python2.5/site-packages/numpy/lib/io.pyc in __init__(self, fid)
     83         # component of the so-called standard library.
     84         import zipfile
---> 85         _zip = zipfile.ZipFile(fid)
     86         self._files = _zip.namelist()
     87         self.files = []

/usr/lib/python2.5/zipfile.pyc in __init__(self, file, mode, compression, allowZip64)
    344 
    345         if key == 'r':
--> 346             self._GetContents()
    347         elif key == 'w':
    348             pass

/usr/lib/python2.5/zipfile.pyc in _GetContents(self)
    364         is bad."""
    365         try:
--> 366             self._RealGetContents()
    367         except BadZipfile:
    368             if not self._filePassed:

/usr/lib/python2.5/zipfile.pyc in _RealGetContents(self)
    374         """Read in the table of contents for the ZIP file."""
    375         fp = self.fp
--> 376         endrec = _EndRecData(fp)
    377         if not endrec:
    378             raise BadZipfile, "File is not a zip file"

/usr/lib/python2.5/zipfile.pyc in _EndRecData(fpin)
    131     The data is a list of the nine items in the ZIP "End of central dir"
    132     record followed by a tenth item, the file seek offset of this record."""
--> 133     fpin.seek(-22, 2)               # Assume no archive comment.
    134     filesize = fpin.tell() + 22     # Get file size
    135     data = fpin.read()

/usr/lib/python2.5/site-packages/numpy/lib/io.pyc in seek(self, offset, whence)
     36 
     37         if whence not in [0, 1]:
---> 38             raise IOError, "Illegal argument"
     39 
     40         if offset < self.offset:

IOError: Illegal argument




Thanks,

Michael


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.31-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-numpy depends on:
ii  libatlas3gf-base [liblapack. 3.6.0-24    Automatically Tuned Linear Algebra
ii  libblas3gf [libblas.so.3gf]  1.2-2       Basic Linear Algebra Subroutines 3
ii  libc6                        2.10.2-2    GNU C Library: Shared libraries
ii  libgcc1                      1:4.4.2-3   GCC support library
ii  libgfortran3                 4.4.2-3     Runtime library for GNU Fortran ap
ii  liblapack3gf [liblapack.so.3 3.2.1-2     library of linear algebra routines
ii  python                       2.5.4-2     An interactive high-level object-o
ii  python-central               0.6.14+nmu2 register and build utility for Pyt

python-numpy recommends no packages.

Versions of packages python-numpy suggests:
ii  python-nose                   0.11.1-1   test discovery and running for Pyt
pn  python-numpy-dbg              <none>     (no description available)
pn  python-numpy-doc              <none>     (no description available)

-- no debconf information




Set Bug forwarded-to-address to 'http://projects.scipy.org/numpy/ticket/1529'. Request was from Sandro Tosi <morph@debian.org> to control@bugs.debian.org. (Wed, 30 Jun 2010 04:51:03 GMT) Full text and rfc822 format available.

Changed Bug forwarded-to-address to 'http://projects.scipy.org/numpy/ticket/1354' from 'http://projects.scipy.org/numpy/ticket/1529' Request was from Sandro Tosi <morph@debian.org> to control@bugs.debian.org. (Sun, 10 Oct 2010 21:27:04 GMT) Full text and rfc822 format available.

Added tag(s) fixed-upstream. Request was from Michael Hanke <mih@debian.org> to control@bugs.debian.org. (Mon, 07 Nov 2011 18:57:16 GMT) Full text and rfc822 format available.

Reply sent to Sandro Tosi <morph@debian.org>:
You have taken responsibility. (Mon, 07 Nov 2011 20:18:03 GMT) Full text and rfc822 format available.

Notification sent to Michael Hanke <michael.hanke@gmail.com>:
Bug acknowledged by developer. (Mon, 07 Nov 2011 20:18:03 GMT) Full text and rfc822 format available.

Message #16 received at 564774-done@bugs.debian.org (full text, mbox):

From: Sandro Tosi <morph@debian.org>
To: 564774-done@bugs.debian.org
Cc: Michael Hanke <mih@debian.org>
Subject: Re: [Python-modules-team] Processed: tagging 564774
Date: Mon, 7 Nov 2011 21:14:35 +0100
Version: 1:1.6.1-1

On Mon, Nov 7, 2011 at 19:57, Debian Bug Tracking System
<owner@bugs.debian.org> wrote:
> Processing commands for control@bugs.debian.org:
>
>> tags 564774 + fixed-upstream

If it's fine for you, it's fine for me too.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 10 May 2012 07:47:11 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 19:46:38 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.