Files
pipenv/news/2718.behavior
T
Tzu-ping Chung 559903f00e Improve "run" behavior on Windows
Some Windows users are used to launch files without specifying a command,
e.g.::

    > my-script.py

This works in the shell because Windows will automatically choose an
command based on file association, and with newer Python versions, the Py
Launcher (py.exe) automatically chooses the correct Python based on
shebang-parsing.

A similar syntax, unfortunately, does not currently work in Pipenv::

    > pipenv run my-script.py

Since my-script.py will be treated as a real application by the subprocess
module.

This patch catch Windows error 193 during subprocess initialization, and
fall back to use COMSPEC (shell=True) when it happens, to provide better
support for this use case.
2018-08-10 13:03:34 +08:00

2 lines
277 B
Plaintext

Fallback to shell mode if `run` fails with Windows error 193 to handle non-executable commands. This should improve usability on Windows, where some users run non-executable files without specifying a command, relying on Windows file association to choose the current command.