Skip to content

Commit d5d976e

Browse files
committed
catch zip
1 parent 6accf04 commit d5d976e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/io/formats/csvs.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from __future__ import print_function
77

88
import csv as csvlib
9+
from zipfile import ZipFile
910
import numpy as np
1011

1112
from pandas.core.dtypes.missing import notna
@@ -127,7 +128,7 @@ def save(self):
127128
else:
128129
encoding = self.encoding
129130

130-
if (not hasattr(self.path_or_buf, 'write') and
131+
if (isinstance(self.path_or_buf, ZipFile) or
131132
self.compression == 'zip'):
132133
is_zip = True
133134
else:

0 commit comments

Comments
 (0)