FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.10] GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS (GH-99768) by miss-islington · Pull Request #99817 · python/cpython · GitHub

Repository navigation

[3.10] GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS (GH-99768) - #99817

Merged
ambv merged 5 commits into
python:3.10from
miss-islington:backport-d08fb25-3.10
Mar 28, 2023
Merged

ambv merged 5 commits into
python:3.10from
miss-islington:backport-d08fb25-3.10

Conversation

miss-islington commented Nov 27, 2022 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

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.
(cherry picked from commit d08fb25)

Co-authored-by: Ronald Oussoren ronaldoussoren@mac.com

…ks on macOS (pythonGH-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.
(cherry picked from commit d08fb25)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
ambv merged commit 5ae5ea8 into python:3.10 Mar 28, 2023
miss-islington deleted the backport-d08fb25-3.10 branch March 28, 2023 12:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL