mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-32457: Improves handling of denormalized executable path when launching Python (GH-5756)
This commit is contained in:
parent
23ad6d0d1a
commit
48e8c82fc6
3 changed files with 54 additions and 54 deletions
|
@ -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.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue