summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2018-02-22 18:39:26 (GMT)
committerGitHub <noreply@github.com>2018-02-22 18:39:26 (GMT)
commit48e8c82fc63d2ddcddce8aa637a892839b551619 (patch)
tree37ad07f40dacd72bbd565fedbbefdd83d57cc4f7 /Lib/test/test_cmd_line.py
parent23ad6d0d1a7a6145a01494f4f3913a63d1f0250c (diff)
downloadcpython-48e8c82fc63d2ddcddce8aa637a892839b551619.zip
cpython-48e8c82fc63d2ddcddce8aa637a892839b551619.tar.gz
cpython-48e8c82fc63d2ddcddce8aa637a892839b551619.tar.bz2
bpo-32457: Improves handling of denormalized executable path when launching Python (GH-5756)
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index fe89e3c..d8a96c4 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -701,6 +701,17 @@ class CmdLineTest(unittest.TestCase):
self.assertEqual(proc.stdout.rstrip(), 'True')
self.assertEqual(proc.returncode, 0, proc)
+ @unittest.skipUnless(sys.platform == 'win32',
+ 'bpo-32457 only applies on Windows')
+ def test_argv0_normalization(self):
+ args = sys.executable, '-c', 'print(0)'
+ prefix, exe = os.path.split(sys.executable)
+ executable = prefix + '\\.\\.\\.\\' + exe
+
+ proc = subprocess.run(args, stdout=subprocess.PIPE,
+ executable=executable)
+ self.assertEqual(proc.returncode, 0, proc)
+ self.assertEqual(proc.stdout.strip(), b'0')
@unittest.skipIf(interpreter_requires_environment(),
'Cannot run -I tests when PYTHON env vars are required.')