Skip to content

Commit 3dcbe01

Browse files
bpo-45901: Fixes argument passing when invoking .py files directly through the Store package (GH-29799)
(cherry picked from commit 4841e69) Co-authored-by: Steve Dower <steve.dower@python.org>
1 parent fc16ea9 commit 3dcbe01

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
When installed through the Microsoft Store and set as the default app for
2+
:file:`*.py` files, command line arguments will now be passed to Python when
3+
invoking a script without explicitly launching Python (that is, ``script.py
4+
args`` rather than ``python script.py args``).

PC/layout/support/appxmanifest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def get_appxmanifest(ns):
430430
["python", "python{}".format(VER_MAJOR), "python{}".format(VER_DOT)],
431431
PYTHON_VE_DATA,
432432
"console",
433-
("python.file", [".py"], '"%1"', "Python File", PY_PNG),
433+
("python.file", [".py"], '"%1" %*', "Python File", PY_PNG),
434434
)
435435

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

447447
if ns.include_pip and ns.include_launchers:

0 commit comments

Comments
 (0)