Inada Naoki <songofaca...@gmail.com> added the comment:
> 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue5758> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com