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 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.
History
Date User Action Args
2021-05-25 04:04:56methanesetrecipients: + methane, amaury.forgeotdarc, jaraco, eric.araujo, r.david.murray, mnewman, tati_alchueyr
2021-05-25 04:04:56methanesetmessageid: <1621915496.52.0.481897848626.issue5758@roundup.psfhosted.org>
2021-05-25 04:04:56methanelinkissue5758 messages
2021-05-25 04:04:56methanecreate