[issue5758] fileinput.hook_compressed returning bytes from gz file

Amaury Forgeot d'Arc report at bugs.python.org
Wed Jul 21 16:23:58 CEST 2010


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

gzip.open() only implements the "rb" mode, and returns bytes.
fileinput could certainly wrap it with a io.TextIOWrapper.

Then the encoding issue arises.
fileinput.FileInput should grow an "encoding" parameter instead of always relying on the default encoding.

----------
keywords: +easy
nosy: +amaury.forgeotdarc
versions:  -Python 2.7

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


More information about the Python-bugs-list mailing list