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 martin.panter
Recipients eryksun, martin.panter, maubp, r.david.murray
Date 2017-04-07.23:23:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491607394.82.0.742921330888.issue30012@psf.upfronthosting.co.za>
In-reply-to
Content
I agree this is not a bug. It is just one of the unfortunate compatibility breaks between Py 2 and 3. Mode="rt" is not one of the values that are supported according to the documentation; adding support would be a new feature.

I understand the file mode handling is stricter on Windows because the underlying OS or C library would crash.

To have code that works with Py 2 and 3, I would switch the mode depending on the version of Python:

if sys.version_info >= (3,):
    handle = gzip.open(filename, "rt")
else:
    handle = gzip.open(filename)
History
Date User Action Args
2017-04-07 23:23:14martin.pantersetrecipients: + martin.panter, r.david.murray, maubp, eryksun
2017-04-07 23:23:14martin.pantersetmessageid: <1491607394.82.0.742921330888.issue30012@psf.upfronthosting.co.za>
2017-04-07 23:23:14martin.panterlinkissue30012 messages
2017-04-07 23:23:14martin.pantercreate