[issue32050] Deprecated python3 -x option

2017-11-20 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4410 ___ Python tracker ___ ___

[issue32050] Deprecated python3 -x option

2017-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset 733b5f3f2f2425fa939d71bc317f2e0f1968c2a0 by Victor Stinner in branch '2.7': bpo-32050: Fix -x option documentation (#4423) https://github.com/python/cpython/commit/733b5f3f2f2425fa939d71bc317f2e0f1968c2a0 --

[issue32050] Deprecated python3 -x option

2017-11-18 Thread STINNER Victor
STINNER Victor added the comment: Ok, I will update the doc instead of deprecating the option. -- ___ Python tracker ___

[issue32050] Deprecated python3 -x option

2017-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It seems to me that the best way is to add the following line at the start of the script: @path\to\python -x %0 %* & exit /b Or @py -3 -x %0 %* & exit /b -- ___ Python

[issue32050] Deprecated python3 -x option

2017-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The current short line of the description was enough to me for understanding what is the purpose of this option and how it can be used (I didn't use Windows for more than 10 years). But I was surprised not founding more detailed

[issue32050] Deprecated python3 -x option

2017-11-17 Thread Terry J. Reedy
Terry J. Reedy added the comment: So the hack is not specific to DOS but is still needed for Windows .bat files. They run in Command Prompt, which was once called the DOS box. (I don't know if they work unaltered in PowerShell.) It seems that the doc should be updated.

[issue32050] Deprecated python3 -x option

2017-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, of course. The py launcher is not an alternative to this "hack". It just allows you to specify just "py" (with possible options -2, -3, -3.6) instead of hardcoding the full name to the Python binary or add the path to

[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor
STINNER Victor added the comment: > @path\to\python -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 Oh wow, I never saw that before. There is now a "py" launcher on Windows, do we still need such "hack"? -- components: +Windows -Interpreter Core nosy: +paul.moore,

[issue32050] Deprecated python3 -x option

2017-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The same as on DOS. Change the extension of the Python script from .py to .bat, and insert the following first line: @path\to\python -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 Now you can run it as a bat-file. The command in the first

[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor
STINNER Victor added the comment: > Python still supports Windows. What is the use case for this option on Windows? On Unix, the first line is usually used for the shebang, a line like: #!/usr/bin/env python3 But this shebang is seen as a comment in Python and

[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4371 ___ Python tracker ___ ___

[issue32050] Deprecated python3 -x option

2017-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python still supports Windows. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor
STINNER Victor added the comment: The note in the documentation is wrong: the line number is correct when using the -x option, even if the first line is skipped. Example with Python 2.7: --- $ cat x.py print(1) print(2) x $ python2 x.py 1 2 Traceback (most recent

[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +4370 stage: -> patch review ___ Python tracker ___

[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor
New submission from STINNER Victor : Python has a -x option documented as a "DOS specific hack only": https://docs.python.org/dev/using/cmdline.html#cmdoption-x Python doesn't support MS-DOS since Python 2.1: