This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author maubp
Recipients eryksun, maubp, r.david.murray
Date 2017-04-07.20:53:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491598422.31.0.269231537042.issue30012@psf.upfronthosting.co.za>
In-reply-to
Content
I want a simple cross platform (Linux/Mac/Windows) and cross version (Python 2/3) way to be able to open a gzipped file and get a string handle (default encoding TextIOWrapper under Python 3 is fine). My use-case is specifically for documentation examples.

Previously I used gzip.open(filename) but with the introduction of Python 3 that stopped working because the Python 3 default was to give you bytes.

Thanks to http://bugs.python.org/issue13989 switching to  gzip.open(filename, "rt") almost covered my use case, leaving Python 2 windows as the odd one out.

I propose that under Python 2.7, gzip.open explicit accept but ignore "t" as part of the mode argument in order to allow cross-platform code to work nicely.

i.e. Formalise the observed Python 2.7 behaviour under Linux and Mac which ignore the "t", and change Windows so that it ignores the "t" as well.
History
Date User Action Args
2017-04-07 20:53:42maubpsetrecipients: + maubp, r.david.murray, eryksun
2017-04-07 20:53:42maubpsetmessageid: <1491598422.31.0.269231537042.issue30012@psf.upfronthosting.co.za>
2017-04-07 20:53:42maubplinkissue30012 messages
2017-04-07 20:53:42maubpcreate