Message394290
| Author |
methane |
| Recipients |
amaury.forgeotdarc, eric.araujo, jaraco, methane, mnewman, r.david.murray, tati_alchueyr |
| Date |
2021年05月25日.04:04:56 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1621915496.52.0.481897848626.issue5758@roundup.psfhosted.org> |
| In-reply-to |
| Content |
> 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. |
|