Skip to content

[3.9] bpo-45901: Fixes argument passing when invoking .py files directly through the Store package (GH-29799) #29808

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

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
When installed through the Microsoft Store and set as the default app for
:file:`*.py` files, command line arguments will now be passed to Python when
invoking a script without explicitly launching Python (that is, ``script.py
args`` rather than ``python script.py args``).
4 changes: 2 additions & 2 deletions PC/layout/support/appxmanifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def get_appxmanifest(ns):
["python", "python{}".format(VER_MAJOR), "python{}".format(VER_DOT)],
PYTHON_VE_DATA,
"console",
("python.file", [".py"], '"%1"', "Python File", PY_PNG),
("python.file", [".py"], '"%1" %*', "Python File", PY_PNG),
)

add_application(
Expand All @@ -441,7 +441,7 @@ def get_appxmanifest(ns):
["pythonw", "pythonw{}".format(VER_MAJOR), "pythonw{}".format(VER_DOT)],
PYTHONW_VE_DATA,
"windows",
("python.windowedfile", [".pyw"], '"%1"', "Python File (no console)", PY_PNG),
("python.windowedfile", [".pyw"], '"%1" %*', "Python File (no console)", PY_PNG),
)

if ns.include_pip and ns.include_launchers:
Expand Down