SIGN IN SIGN UP

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.
R
Ronald Oussoren committed
d08fb257698e3475d6f69bb808211d39e344e5b2
Parent: 9c9f085
Committed by GitHub <noreply@github.com> on 11/27/2022, 10:56:14 AM