Skip to content

Commit b3e935f

Browse files
1 parent c0743a8 commit b3e935f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bisect/47871.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# BUG: to_csv requires escapechar unnecessarily when data contains
22
# null byte \x00 (PowerShell only) #47871
33

4+
import csv
45
import pandas as pd
56

67
print(pd.__version__)
78

89
df = pd.DataFrame({"A": ["\x00"]})
9-
df.to_csv("null_byte.csv", index=False)
10+
try:
11+
df.to_csv("null_byte.csv", index=False)
12+
except csv.Error as e:
13+
print(e)
14+
else:
15+
exit(1)

0 commit comments

Comments
 (0)