Skip to content

Commit 0099438

Browse files
ahawrylukJulianWgs
authored andcommitted
TST: csv parser segfaulting on malformed input. (pandas-dev#40458)
1 parent 2f8919c commit 0099438

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/io/parser/common/test_common_basic.py

+9
Original file line numberDiff line numberDiff line change
@@ -753,3 +753,12 @@ def test_encoding_surrogatepass(all_parsers):
753753
tm.assert_frame_equal(df, expected)
754754
with pytest.raises(UnicodeDecodeError, match="'utf-8' codec can't decode byte"):
755755
parser.read_csv(path)
756+
757+
758+
def test_malformed_second_line(all_parsers):
759+
# see GH14782
760+
parser = all_parsers
761+
data = "\na\nb\n"
762+
result = parser.read_csv(StringIO(data), skip_blank_lines=False, header=1)
763+
expected = DataFrame({"a": ["b"]})
764+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)