Skip to content

Commit 376dce3

Browse files
committed
Close bz2 file object in Python 2
1 parent b88d1b8 commit 376dce3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pandas/io/common.py

+1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def _get_handle(path_or_buf, mode, encoding=None, compression=None,
324324
# Python 2's bz2 module can't take file objects, so have to
325325
# run through decompress manually
326326
f = StringIO(bz2.decompress(path_or_buf.read()))
327+
path_or_buf.close()
327328
else:
328329
f = bz2.BZ2File(path_or_buf)
329330

0 commit comments

Comments
 (0)