Skip to content

Commit fdd3ce9

Browse files
committed
handle encoding type
1 parent b237b11 commit fdd3ce9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/io/formats/csvs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def save(self):
154154
# GH 17778 handles compression for byte strings.
155155
if not close and self.compression:
156156
f.close()
157-
with open(f.name, 'r') as f:
158-
data = f.read()
157+
with open(f.name, 'rb') as f:
158+
data = f.read().decode(encoding)
159159
f, handles = _get_handle(f.name, self.mode,
160160
encoding=encoding,
161161
compression=self.compression)

0 commit comments

Comments
 (0)