diff options
author | Allan Haldane <allan.haldane@gmail.com> | 2018-05-30 14:44:39 -0400 |
---|---|---|
committer | Allan Haldane <allan.haldane@gmail.com> | 2018-05-30 17:43:51 -0400 |
commit | 0c4ebf1cd396f3cfa1e218b2a0e46f1bc84f9614 (patch) | |
tree | 34a44fbc26b2725386ab2cc57641114a69fae4a6 /numpy/lib/tests/test__iotools.py | |
parent | 6721890e86291b53fb8dcbee6809891c348ae98e (diff) | |
download | numpy-0c4ebf1cd396f3cfa1e218b2a0e46f1bc84f9614.tar.gz |
BUG: delimiter/comments in genfromtxt should be encoded
Fixes #11028
Diffstat (limited to 'numpy/lib/tests/test__iotools.py')
-rw-r--r-- | numpy/lib/tests/test__iotools.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py index 5f6c29a4d..b4888f1bd 100644 --- a/numpy/lib/tests/test__iotools.py +++ b/numpy/lib/tests/test__iotools.py @@ -53,6 +53,11 @@ class TestLineSplitter(object): test = LineSplitter(',')(strg) assert_equal(test, ['1', '2', '3', '4', '', '5']) + # gh-11028 bytes comment/delimiters should get encoded + strg = b" 1,2,3,4,,5 % test" + test = LineSplitter(delimiter=b',', comments=b'%')(strg) + assert_equal(test, ['1', '2', '3', '4', '', '5']) + def test_constant_fixed_width(self): "Test LineSplitter w/ fixed-width fields" strg = " 1 2 3 4 5 # test" |