From 0b0c8035a4e2629cdb0fcafb2a59840f77ebec5c Mon Sep 17 00:00:00 2001 From: Blake Griffith Date: Tue, 24 Mar 2015 00:06:41 -0500 Subject: BUG: Make read_array_header_* return results Previously read_array_header_1_0 & read_array_header_2_0 were not returning the documented results. Closes #5602 --- numpy/lib/format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/format.py') diff --git a/numpy/lib/format.py b/numpy/lib/format.py index 1a2133aa9..4f96ff4bc 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -389,7 +389,7 @@ def read_array_header_1_0(fp): If the data is invalid. """ - _read_array_header(fp, version=(1, 0)) + return _read_array_header(fp, version=(1, 0)) def read_array_header_2_0(fp): """ @@ -422,7 +422,7 @@ def read_array_header_2_0(fp): If the data is invalid. """ - _read_array_header(fp, version=(2, 0)) + return _read_array_header(fp, version=(2, 0)) def _filter_header(s): -- cgit v1.2.1 From 475a6403f9b10d2c4fa30fa0ad807b9ca1d2d0d6 Mon Sep 17 00:00:00 2001 From: Blake Griffith Date: Tue, 24 Mar 2015 15:36:30 -0500 Subject: BUG: don't ignore version passed to format.write_array Previously the passed in version was ignored --- numpy/lib/format.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'numpy/lib/format.py') diff --git a/numpy/lib/format.py b/numpy/lib/format.py index 4f96ff4bc..a0405b310 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -314,21 +314,19 @@ def _write_array_header(fp, d, version=None): header = header + ' '*topad + '\n' header = asbytes(_filter_header(header)) - if len(header) >= (256*256) and version == (1, 0): - raise ValueError("header does not fit inside %s bytes required by the" - " 1.0 format" % (256*256)) - if len(header) < (256*256): - header_len_str = struct.pack('