Message291307
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) |
|
Date |
User |
Action |
Args |
2017-04-07 23:23:14 | martin.panter | set | recipients:
+ martin.panter, r.david.murray, maubp, eryksun |
2017-04-07 23:23:14 | martin.panter | set | messageid: <1491607394.82.0.742921330888.issue30012@psf.upfronthosting.co.za> |
2017-04-07 23:23:14 | martin.panter | link | issue30012 messages |
2017-04-07 23:23:14 | martin.panter | create | |
|