summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2021-11-26 23:08:20 (GMT)
committerGitHub <noreply@github.com>2021-11-26 23:08:20 (GMT)
commit4841e694ee1686f8c933ddfcb8c854915867ce17 (patch)
treea1ad49e7e5d7b3e0431e2eeb7e1ff7952e6eab79
parent94daf39b2f7e9b50e7ae7a16caeef804f8e37ae3 (diff)
downloadcpython-4841e694ee1686f8c933ddfcb8c854915867ce17.zip
cpython-4841e694ee1686f8c933ddfcb8c854915867ce17.tar.gz
cpython-4841e694ee1686f8c933ddfcb8c854915867ce17.tar.bz2
bpo-45901: Fixes argument passing when invoking .py files directly through the Store package (GH-29799)
-rw-r--r--Misc/NEWS.d/next/Windows/2021-11-26-18-17-41.bpo-45901.c5IBqM.rst4
-rw-r--r--PC/layout/support/appxmanifest.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/Misc/NEWS.d/next/Windows/2021-11-26-18-17-41.bpo-45901.c5IBqM.rst b/Misc/NEWS.d/next/Windows/2021-11-26-18-17-41.bpo-45901.c5IBqM.rst
new file mode 100644
index 0000000..2cb872b
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2021-11-26-18-17-41.bpo-45901.c5IBqM.rst
@@ -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``).
diff --git a/PC/layout/support/appxmanifest.py b/PC/layout/support/appxmanifest.py
index 747c97a..15119b0 100644
--- a/PC/layout/support/appxmanifest.py
+++ b/PC/layout/support/appxmanifest.py
@@ -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(
@@ -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: