Skip to content

Emscripten: Make python.sh function as proper Python CLI #127503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hoodmane opened this issue Dec 2, 2024 · 0 comments · Fixed by #127506
Closed

Emscripten: Make python.sh function as proper Python CLI #127503

hoodmane opened this issue Dec 2, 2024 · 0 comments · Fixed by #127506
Labels
OS-emscripten type-bug An unexpected behavior, bug, or error

Comments

@hoodmane
Copy link
Contributor

hoodmane commented Dec 2, 2024

There are several problems with python.sh right now:

  1. It doesn't work correctly on macs with bsd coreutils
  2. It doesn't mount the native file system into the Emscripten file system, so python.sh /some/file.py will fail to find the file
  3. It doesn't set the current directory in the Emscripten file system to the same as the host working directory so python.sh file.py won't look for file.py in the current directory
  4. It doesn't inherit environment variables

@freakboy3742

Linked PRs

@hoodmane hoodmane changed the title Emscripten: Make python.sh function as a proper CLI entrypoint Emscripten: Make python.sh function as proper Python CLI Dec 2, 2024
@picnixz picnixz added the type-bug An unexpected behavior, bug, or error label Dec 2, 2024
freakboy3742 pushed a commit that referenced this issue Dec 5, 2024
…127506)

Modifies the python.sh script to work on macOS, and adapt to recent emscripten changes.
@hoodmane hoodmane reopened this Dec 5, 2024
hoodmane added a commit to hoodmane/cpython that referenced this issue Dec 5, 2024
hoodmane added a commit to hoodmane/cpython that referenced this issue Dec 5, 2024
This makes `shutil.which()` pick up native executables which is inconvenient.
freakboy3742 pushed a commit that referenced this issue Dec 9, 2024
Modifies the handling of PATH to ensure that native executables aren't picked
up when running under node.
freakboy3742 pushed a commit that referenced this issue Dec 9, 2024
Corrects the handling of realpath on Linux.
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
…CLI (python#127506)

Modifies the python.sh script to work on macOS, and adapt to recent emscripten changes.
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
…hon#127633)

Modifies the handling of PATH to ensure that native executables aren't picked
up when running under node.
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
hoodmane added a commit to hoodmane/cpython that referenced this issue Mar 12, 2025
This PR solves two problems:
1. No Python traceback shown on segfault/trap
2. The JavaScript source line is shown

The JavaScript source line is super long and completely unenlightening,
whereas the Python traceback is very helpful.
hoodmane added a commit to hoodmane/cpython that referenced this issue Mar 12, 2025
This PR solves two problems:
1. No Python traceback shown on segfault/trap
2. The JavaScript source line is shown

The JavaScript source line is super long and completely unenlightening,
whereas the Python traceback is very helpful.
hoodmane added a commit to hoodmane/cpython that referenced this issue Mar 12, 2025
This PR solves two problems:
1. No Python traceback shown on segfault/trap
2. The JavaScript source line is shown

The JavaScript source line is super long and completely unenlightening,
whereas the Python traceback is very helpful.
freakboy3742 pushed a commit that referenced this issue Mar 13, 2025
…1158)

Modifies the behavior of the interpreter on crash under Emscripten:
1. No Python traceback shown on segfault/trap
2. The JavaScript source line is shown

The JavaScript source line is super long and completely unenlightening,
whereas the Python traceback is very helpful.
plashchynski pushed a commit to plashchynski/cpython that referenced this issue Mar 17, 2025
python#131158)

Modifies the behavior of the interpreter on crash under Emscripten:
1. No Python traceback shown on segfault/trap
2. The JavaScript source line is shown

The JavaScript source line is super long and completely unenlightening,
whereas the Python traceback is very helpful.
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
python#131158)

Modifies the behavior of the interpreter on crash under Emscripten:
1. No Python traceback shown on segfault/trap
2. The JavaScript source line is shown

The JavaScript source line is super long and completely unenlightening,
whereas the Python traceback is very helpful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-emscripten type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants