GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Exception using fileinput.hook_compressed in binary mode · Issue #101961 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportWhen using the # fileinput_cat.py import fileinput import sys with fileinput.input(mode='rb', openhook=fileinput.hook_compressed) as f: for line in f: sys.stdout.buffer.write(line) $ python3.10 fileinput_cat.py fileinput_cat.py Traceback (most recent call last): File "fileinput_bug.py", line 5, in <module> for line in f: File ".../lib/python3.10/fileinput.py", line 256, in __next__ line = self._readline() File ".../lib/python3.10/fileinput.py", line 385, in _readline self._file = self._openhook(self._filename, self._mode) File ".../lib/python3.10/fileinput.py", line 432, in hook_compressed return open(filename, mode, encoding=encoding, errors=errors) ValueError: binary mode doesn't take an encoding argument Your environmentI tried this on Python 3.10.9 (installed from nixpkgs) on Intel macOS 11.7.3. It was working on Python 3.9.16. Linked PRs
Activity
MetadataMetadataLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |