Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-124241: try reading/proc/self/exe to determinesys.executable#145486

Open
FFY00 wants to merge 1 commit intopython:mainfrom
FFY00:gh-124241
Open

GH-124241: try reading/proc/self/exe to determinesys.executable#145486
FFY00 wants to merge 1 commit intopython:mainfrom
FFY00:gh-124241

Conversation

@FFY00
Copy link
Member

@FFY00FFY00 commentedMar 3, 2026
edited
Loading

$ bash -c"exec -a echo$(pwd)/python -c 'import sys; print(sys.executable)'"/home/anubis/git/cpython/python

Comment on lines +268 to +273
if not executable and os_name == 'posix':
# On Linux, try resolving the executable path via procfs
try:
executable = realpath('/proc/self/exe')
except (OSError, MemoryError):
pass
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Humm, perhaps we should do this after tryingprogram_name, and only update the value if the executable path derived fromprogram_name doesn't resolve to the same path as/proc/self/exe.

Ifprogam_name is set and resolves to the same path as/proc/self/exe, honoring its value should be nicer.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@FFY00

[8]ページ先頭

©2009-2026 Movatter.jp