File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed
Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ def save(self):
142142 elif hasattr (self .path_or_buf , 'write' ):
143143 f = self .path_or_buf
144144 close = False
145+ if self .compression :
146+ import warnings
147+ msg = ("compression has no effect when passing file-like "
148+ "object as input." )
149+ warnings .warn (msg , RuntimeWarning , stacklevel = 2 )
145150 else :
146151 f , handles = _get_handle (self .path_or_buf , self .mode ,
147152 encoding = encoding ,
@@ -179,19 +184,6 @@ def save(self):
179184 for _fh in handles :
180185 _fh .close ()
181186
182- # GH 17778 handles zip compression for byte strings separately.
183- # if path is not None:
184- # buf = f.getvalue()
185- # f, handles = _get_handle(path, self.mode,
186- # encoding=encoding,
187- # compression=self.compression)
188- # f.write(buf)
189- #
190- # if not py2zip:
191- # f.close()
192- # for _fh in handles:
193- # _fh.close()
194-
195187 def _save_header (self ):
196188
197189 writer = self .writer
You can’t perform that action at this time.
0 commit comments