Skip to content

Python 3.11.0b4 - py launcher fails when running a script with a shebang line #94772

@pfmoore

Description

@pfmoore

Bug report

When running a script with a "shebang" line, the py.exe launcher in Python 3.11.0b4 fails with an error:

To reproduce, create the following script as x.py:

#!/usr/bin/env python
import sys
print(sys.version)
print(sys.executable)

Run the script using py.exe built from a 3.11.0b4 checkout using build.bat:

❯ .\amd64\py.exe .\x.py
 .\x.py': The system cannot find the file specified.ata\Local\Programs\Python\Python310\python.exe

Note the truncated python executable name. This appears to be related to the use of CRLF line endings in the file - if I switch to LF line endings, I get

❯ .\amd64\py.exe .\x.py
Unable to create process using 'C:\Users\Gustav\AppData\Local\Programs\Python\Python310\python.exe
 .\x.py': The system cannot find the file specified.

Your environment

  • Launcher from 3.11.0b4, but the active Python version is 3.10.3.
  • Operating system and architecture: Windows 11, 64-bit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy