Skip to content

Commit 166b4bb

Browse files
jbrockmendelWillAyd
authored andcommitted
Backport PR pandas-dev#29294 for 0.25.3 whatsnew
1 parent 8c80df0 commit 166b4bb

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

pandas/io/parsers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,7 @@ def _next_iter_line(self, row_num):
29352935
if self.warn_bad_lines or self.error_bad_lines:
29362936
msg = str(e)
29372937

2938-
if "NULL byte" in msg:
2938+
if "NULL byte" in msg or "line contains NUL" in msg:
29392939
msg = (
29402940
"NULL byte detected. This byte "
29412941
"cannot be processed in Python's "

pandas/tests/io/parser/test_common.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1898,10 +1898,7 @@ def test_null_byte_char(all_parsers):
18981898
out = parser.read_csv(StringIO(data), names=names)
18991899
tm.assert_frame_equal(out, expected)
19001900
else:
1901-
if compat.PY38:
1902-
msg = "line contains NUL"
1903-
else:
1904-
msg = "NULL byte detected"
1901+
msg = "NULL byte detected"
19051902
with pytest.raises(ParserError, match=msg):
19061903
parser.read_csv(StringIO(data), names=names)
19071904

0 commit comments

Comments
 (0)