Peter added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30012>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to