Message394290
> I'm struggling with how to adapt the code to provide a uniform interface on Python 3.6+.
It's easy. Just passing `mode="rb"`.
```
FileInput(filelist, mode="rb", openhook=fileinput.hook_compressed)
```
This is better than `backports.hook_compressed`, because it returns bytes always regardless file is compressed or uncompressed. |
|
Date |
User |
Action |
Args |
2021-05-25 04:04:56 | methane | set | recipients:
+ methane, amaury.forgeotdarc, jaraco, eric.araujo, r.david.murray, mnewman, tati_alchueyr |
2021-05-25 04:04:56 | methane | set | messageid: <1621915496.52.0.481897848626.issue5758@roundup.psfhosted.org> |
2021-05-25 04:04:56 | methane | link | issue5758 messages |
2021-05-25 04:04:56 | methane | create | |
|