]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45901: Fixes argument passing when invoking .py files directly through the Store...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 26 Nov 2021 23:43:12 +0000 (15:43 -0800)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 23:43:12 +0000 (23:43 +0000)
Misc/NEWS.d/next/Windows/2021-11-26-18-17-41.bpo-45901.c5IBqM.rst [new file with mode: 0644]
PC/layout/support/appxmanifest.py

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 (file)
index 0000000..2cb872b
--- /dev/null
@@ -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``).
index 747c97a00699dd70d5a4c3afac41676e44d7988a..15119b02a802a7bdc7f37c6eab8ca4b36396c358 100644 (file)
@@ -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: