[issue5758] fileinput.hook_compressed returning bytes from gz file

Jason R. Coombs report at bugs.python.org
Tue May 25 08:37:27 EDT 2021


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I did consider and confirm that mode="rb" does also provide a uniform solution, but it also regresses the behavior of uncompressed inputs, making them bytes where they were text. This approach feels like the "Python 1" compatibility approach.

At least in my case, the preference was to migrate to the future behavior, where all content is decoded to Unicode text, without having to wait for Python 3.9 to sunset.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue5758>
_______________________________________


More information about the Python-bugs-list mailing list