diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2022-11-27 10:56:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 10:56:14 (GMT) |
commit | d08fb257698e3475d6f69bb808211d39e344e5b2 (patch) | |
tree | 2337d2b5d1f350a78ac65136d399bf22773c49d8 /Misc | |
parent | 9c9f085e9a1d1464376ea421e5c96472ca11c3b4 (diff) | |
download | cpython-d08fb257698e3475d6f69bb808211d39e344e5b2.zip cpython-d08fb257698e3475d6f69bb808211d39e344e5b2.tar.gz cpython-d08fb257698e3475d6f69bb808211d39e344e5b2.tar.bz2 |
GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS (#99768)
On macOS all file descriptors for a particular file in /dev/fd
share the same file offset, that is ``open("/dev/fd/9", "r")`` behaves
more like ``dup(9)`` than a regular open.
This causes problems when a user tries to run "/dev/fd/9" as a script
because zipimport changes the file offset to try to read a zipfile
directory. Therefore change zipimport to reset the file offset after
trying to read the zipfile directory.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/macOS/2022-11-25-09-23-20.gh-issue-87235.SifjCD.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/macOS/2022-11-25-09-23-20.gh-issue-87235.SifjCD.rst b/Misc/NEWS.d/next/macOS/2022-11-25-09-23-20.gh-issue-87235.SifjCD.rst new file mode 100644 index 0000000..3111e49 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2022-11-25-09-23-20.gh-issue-87235.SifjCD.rst @@ -0,0 +1 @@ +On macOS ``python3 /dev/fd/9 9</path/to/script.py`` failed for any script longer than a couple of bytes. |