diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-02-20 02:18:43 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2018-02-20 02:18:43 (GMT) |
commit | 8e149ff481acbb3889c825b8bf7b10aa191f09a7 (patch) | |
tree | 97c994f4085daa886d5ae0c47ac469af61fce229 /Lib/test | |
parent | ef0bb5c7b76a49a5f3c5b85b5f9112cfefe54328 (diff) | |
download | cpython-8e149ff481acbb3889c825b8bf7b10aa191f09a7.zip cpython-8e149ff481acbb3889c825b8bf7b10aa191f09a7.tar.gz cpython-8e149ff481acbb3889c825b8bf7b10aa191f09a7.tar.bz2 |
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5766)
(cherry picked from commit 6240917b773b52f8883387b9e3a5f327a4372068)
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_venv.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index 0c1ea89..2569a1f 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -286,6 +286,24 @@ class BasicTest(BaseTest): out, err = p.communicate() self.assertEqual(out.strip(), envpy.encode()) + @unittest.skipUnless(os.name == 'nt', 'only relevant on Windows') + def test_unicode_in_batch_file(self): + """ + Test isolation from system site-packages + """ + rmtree(self.env_dir) + env_dir = os.path.join(os.path.realpath(self.env_dir), 'ϼўТλФЙ') + builder = venv.EnvBuilder(clear=True) + builder.create(env_dir) + activate = os.path.join(env_dir, self.bindir, 'activate.bat') + envpy = os.path.join(env_dir, self.bindir, self.exe) + cmd = [activate, '&', self.exe, '-c', 'print(0)'] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, encoding='oem', + shell=True) + out, err = p.communicate() + print(err) + self.assertEqual(out.strip(), '0') @skipInVenv class EnsurePipTest(BaseTest): |