diff options
author | Pauli Virtanen <pav@iki.fi> | 2010-02-20 18:12:29 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2010-02-20 18:12:29 +0000 |
commit | cb8c9b33c94d078e56e5ffaf22061aeab317d3a1 (patch) | |
tree | d8add9fdc170abe3548cb9290929b410a9c37a75 /numpy/lib/io.py | |
parent | f8401465c6b5876c57d3908e38ca37c39695033f (diff) | |
download | numpy-cb8c9b33c94d078e56e5ffaf22061aeab317d3a1.tar.gz |
3K: lib: bytes vs. str fixes in lib.format and lib.io
Diffstat (limited to 'numpy/lib/io.py')
-rw-r--r-- | numpy/lib/io.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/io.py b/numpy/lib/io.py index ec3f39cc2..83fd4d809 100644 --- a/numpy/lib/io.py +++ b/numpy/lib/io.py @@ -23,6 +23,8 @@ from _iotools import LineSplitter, NameValidator, StringConverter, \ _is_string_like, has_nested_fields, flatten_dtype, \ easy_dtype +from numpy.compat import asbytes + _file = open _string_like = _is_string_like @@ -282,7 +284,7 @@ def load(file, mmap_mode=None): fid = file # Code to distinguish from NumPy binary files and pickles. - _ZIP_PREFIX = 'PK\x03\x04' + _ZIP_PREFIX = asbytes('PK\x03\x04') N = len(format.MAGIC_PREFIX) magic = fid.read(N) fid.seek(-N, 1) # back-up |