From a1a99b4bb7cbe2dbc55a1d92c3c509b4466d3c3b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 9 Dec 2019 17:34:02 +0100 Subject: bpo-20443: No longer make sys.argv[0] absolute for script (GH-17534) In Python 3.9.0a1, sys.argv[0] was made an asolute path if a filename was specified on the command line. Revert this change, since most users expect sys.argv to be unmodified. --- Python/initconfig.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Python/initconfig.c') diff --git a/Python/initconfig.c b/Python/initconfig.c index caa9bf5f56..74c9ca007e 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -2198,10 +2198,6 @@ config_update_argv(PyConfig *config, Py_ssize_t opt_index) /* Force sys.argv[0] = '-m'*/ arg0 = L"-m"; } - else if (config->run_filename != NULL) { - /* run_filename is converted to an absolute path: update argv */ - arg0 = config->run_filename; - } if (arg0 != NULL) { arg0 = _PyMem_RawWcsdup(arg0); -- cgit v1.2.1