From 5f65770ff5cf02a727d5e486c7cd2630616ccc84 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Wed, 30 Oct 2019 08:37:39 -0700 Subject: [PATCH 1/2] troubleshoot CI --- pandas/io/parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index c82486532530f..058d65b9464ae 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -2929,7 +2929,7 @@ def _next_iter_line(self, row_num): if self.warn_bad_lines or self.error_bad_lines: msg = str(e) - if "NULL byte" in msg: + if "NULL byte" in msg or "line contains NUL" in msg: msg = ( "NULL byte detected. This byte " "cannot be processed in Python's " From 4954552fb573797c1747da4122e07f1357e19e25 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Wed, 30 Oct 2019 09:56:27 -0700 Subject: [PATCH 2/2] update message --- pandas/tests/io/parser/test_common.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandas/tests/io/parser/test_common.py b/pandas/tests/io/parser/test_common.py index 3d657418e43cd..6e6c31bc5b972 100644 --- a/pandas/tests/io/parser/test_common.py +++ b/pandas/tests/io/parser/test_common.py @@ -1915,10 +1915,7 @@ def test_null_byte_char(all_parsers): out = parser.read_csv(StringIO(data), names=names) tm.assert_frame_equal(out, expected) else: - if compat.PY38: - msg = "line contains NUL" - else: - msg = "NULL byte detected" + msg = "NULL byte detected" with pytest.raises(ParserError, match=msg): parser.read_csv(StringIO(data), names=names)