We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7960f6 commit 85630eaCopy full SHA for 85630ea
pandas/parser.pyx
@@ -621,8 +621,9 @@ cdef class TextReader:
621
if isinstance(source, basestring) or PY3:
622
source = bz2.BZ2File(source, 'rb')
623
else:
624
- raise ValueError('Python 2 cannot read bz2 from open file '
625
- 'handle')
+ content = source.read()
+ source.close()
626
+ source = compat.StringIO(bz2.decompress(content))
627
elif self.compression == 'zip':
628
import zipfile
629
zip_file = zipfile.ZipFile(source)
0 commit comments