summaryrefslogtreecommitdiff
path: root/numpy/lib/io.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/io.py')
-rw-r--r--numpy/lib/io.py4
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