diff options
author | Aron Ahmadia <aron@ahmadia.net> | 2012-07-17 16:59:50 -0500 |
---|---|---|
committer | Aron Ahmadia <aron@ahmadia.net> | 2012-07-17 16:59:50 -0500 |
commit | a419a3036aa8202d00eb6e857c79d66adc56bed0 (patch) | |
tree | 4a73e6fff2ee13b35c154c43bd7b58bb6c2af633 /numpy/lib/npyio.py | |
parent | 7316499dd60baa7bb260875b79f7d22be491c986 (diff) | |
parent | 6c772fab57934d24b66638ea5001eb02d1662f5e (diff) | |
download | numpy-a419a3036aa8202d00eb6e857c79d66adc56bed0.tar.gz |
Merge branch 'master' of https://github.com/numpy/numpy into patch-2
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r-- | numpy/lib/npyio.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index 221529929..b63003f80 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -359,7 +359,6 @@ def load(file, mmap_mode=None): own_fid = True elif isinstance(file, gzip.GzipFile): fid = seek_gzip_factory(file) - own_fid = True else: fid = file @@ -371,7 +370,7 @@ def load(file, mmap_mode=None): fid.seek(-N, 1) # back-up if magic.startswith(_ZIP_PREFIX): # zip-file (assume .npz) own_fid = False - return NpzFile(fid, own_fid=True) + return NpzFile(fid, own_fid=own_fid) elif magic == format.MAGIC_PREFIX: # .npy file if mmap_mode: return format.open_memmap(file, mode=mmap_mode) @@ -471,8 +470,7 @@ def savez(file, *args, **kwds): -------- save : Save a single array to a binary file in NumPy format. savetxt : Save an array to a file as plain text. - numpy.savez_compressed : Save several arrays into a compressed .npz file - format + savez_compressed : Save several arrays into a compressed .npz file format Notes ----- @@ -1293,7 +1291,8 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None, """ # Py3 data conversions to bytes, for convenience - comments = asbytes(comments) + if comments is not None: + comments = asbytes(comments) if isinstance(delimiter, unicode): delimiter = asbytes(delimiter) if isinstance(missing, unicode): |