From ae423c3de5e0768df7ff7a4e2a09f17a9531698d Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sat, 2 Mar 2019 14:28:18 -0800 Subject: BUG: Fix errors in string formatting while producing an error `"Invalid version %r" % (1, 2)` would fail with `TypeError: not all arguments converted during string formatting` The `Header is not a dictionary` error had a similar problem. Fixed by changing this entire function to use `.format` in place of `%`, which does not have this gotcha. Found using LGTM.com --- numpy/lib/format.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'numpy/lib/format.py') diff --git a/numpy/lib/format.py b/numpy/lib/format.py index 7648be615..4da1022ca 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -524,7 +524,7 @@ def _read_array_header(fp, version): elif version == (2, 0): hlength_type = '