diff options
author | gfyoung <gfyoung17@gmail.com> | 2016-12-06 14:48:03 -0500 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2016-12-08 12:40:39 -0500 |
commit | df00a6fa1afca742288a75c7b883f901668e0619 (patch) | |
tree | c040c8d315a812a7f00c471dfb74ee7b883917ee /numpy/lib/npyio.py | |
parent | 62694d219bd4c768bcd93b85257298bd656817c9 (diff) | |
download | numpy-df00a6fa1afca742288a75c7b883f901668e0619.tar.gz |
BUG: Apply more robust string converts in loadtxt
The original dtype converters for bytes and str
did not account for converting objects of str or
bytes dtype respectively. Replace the original
converters with those from numpy.compat, which
are much more robust.
Closes gh-8033.
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r-- | numpy/lib/npyio.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index 05010a2d0..13eb5cefc 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -702,9 +702,9 @@ def _getconv(dtype): elif issubclass(typ, np.complex): return lambda x: complex(asstr(x)) elif issubclass(typ, np.bytes_): - return bytes + return asbytes else: - return str + return asstr def loadtxt(fname, dtype=float, comments='#', delimiter=None, |