GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [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

Conversation

@miss-islington

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

Uh oh!

There was an error while loading. Please reload this page.

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 [email protected]

  • Issue: Python fails to read a script whose path is /dev/fd/X #87235

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ronaldoussoren @miss-islington
pythonGH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" wor…
2136b09
…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 <[email protected]>
@miss-islington
miss-islington requested review from brettcannon, encukou, ericsnowcurrently, ncoghlan and warsaw as code owners November 27, 2022 10:56
This was referenced Nov 27, 2022
Python fails to read a script whose path is /dev/fd/X #87235
Closed
GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS #99768
Merged
@bedevere-bot bedevere-bot added the awaiting review label Nov 27, 2022
@brettcannon
brettcannon removed their request for review November 30, 2022 01:03
@kumaraditya303 kumaraditya303 assigned ronaldoussoren Dec 16, 2022
hauntsaninja and others added 4 commits January 29, 2023 13:11
@hauntsaninja
Merge branch '3.10' into backport-d08fb25-3.10
dc0314c
@hauntsaninja
Merge branch '3.10' into backport-d08fb25-3.10
0b16e4b
@ambv
Merge branch '3.10' into backport-d08fb25-3.10
65c15ab
@ambv
Regen zipimport
4775df1
@ambv
ambv merged commit 5ae5ea8 into python:3.10 Mar 28, 2023
@bedevere-bot bedevere-bot removed the awaiting review label Mar 28, 2023
@miss-islington
miss-islington deleted the backport-d08fb25-3.10 branch March 28, 2023 12:13
@encukou encukou mentioned this pull request Oct 8, 2024
gh-100005: Skip test_script_as_dev_fd() on FreeBSD #100006
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou Awaiting requested review from encukou encukou is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ronaldoussoren ronaldoussoren

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@miss-islington @ambv @ronaldoussoren @bedevere-bot @hauntsaninja
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.