This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: sys.argv is processed strangely under Windows
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: DerSchinken, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2021-10-11 15:38 by DerSchinken, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg403656 - (view) Author: Paul (DerSchinken) Date: 2021-10-11 15:38
here is my test file:
'''
import sys
print(sys.argv)
'''

when I then try 'python test.py ^test' the ^ character is stripped away, this doesn't happen on Linux. This also doesn't happen if I put ^test in quotes (only ") the ' quotes don't work
msg403657 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2021-10-11 15:49
This is Windows behavior, not Python; ^ is an escape character in cmd.exe.  Try for example `echo test ^| python -c "print('hello world')"` with and without the ^ character.
msg403658 - (view) Author: Paul (DerSchinken) Date: 2021-10-11 15:57
oh ok. thx
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89595
2021-10-11 15:57:24DerSchinkensetmessages: + msg403658
2021-10-11 15:49:15zach.waresetstatus: open -> closed
resolution: not a bug
messages: + msg403657

stage: resolved
2021-10-11 15:38:52DerSchinkencreate