@@ -624,7 +624,7 @@ def _get(section_dict, key, default=None):
624624__version_date__ = str(__version_date_info__[0]) + "." + str(
625625 __version_date_info__[1]).zfill(2) + "." + str(__version_date_info__[2]).zfill(2)
626626__revision__ = __version_info__[3]
627- __revision_id__ = "$Id: b2001346d87a317d45baa263189fe0b47f852466 $"
627+ __revision_id__ = "$Id: d7e14be5ade4c044169dc9a920876d5c0e15ba6e $"
628628if(__version_info__[4] is not None):
629629 __version_date_plusrc__ = __version_date__ + \
630630 "-" + str(__version_date_info__[4])
@@ -8886,8 +8886,23 @@ def UncompressFileAlt(fp, formatspecs=__file_format_multi_dict__, filestart=0,
88868886
88878887 return FileLikeAdapter(fp, mode="rb", mm=mm)
88888888
8889- def UncompressFile(infile, formatspecs=__file_format_multi_dict__, mode="rb",
8890- filestart=0, use_mmap=False):
8889+ def UncompressFileAlt(fp, formatspecs=__file_format_multi_dict__, filestart=0,
8890+ use_mmap=False):
8891+ """
8892+ Accepts an already-open *bytes* file-like (fp). Detects compression and
8893+ returns a FileLikeAdapter opened for 'rb'. If the stream is uncompressed
8894+ and backed by a real file, you can enable mmap via use_mmap=True.
8895+ """
8896+ if not hasattr(fp, "read"):
8897+ return False
8898+
8899+ # If caller already gave us a FileLikeAdapter => honor it and return it.
8900+ if isinstance(fp, FileLikeAdapter):
8901+ try:
8902+ fp.write_through = True
8903+ except Exception:
8904+ pass
8905+ return fp
88918906 """
88928907 Opens a path, detects compression by header, and returns a FileLikeAdapter.
88938908 If uncompressed and use_mmap=True, returns an mmap-backed reader.
0 commit comments