summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_venv.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2018-02-20 01:25:24 (GMT)
committerGitHub <noreply@github.com>2018-02-20 01:25:24 (GMT)
commit6240917b773b52f8883387b9e3a5f327a4372068 (patch)
treef31ad9b8b1eef5f4174db12478ff9b71ac2d26d6 /Lib/test/test_venv.py
parent5537646bfacec463b450871dde31cb06c44a0556 (diff)
downloadcpython-6240917b773b52f8883387b9e3a5f327a4372068.zip
cpython-6240917b773b52f8883387b9e3a5f327a4372068.tar.gz
cpython-6240917b773b52f8883387b9e3a5f327a4372068.tar.bz2
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5757)
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r--Lib/test/test_venv.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index c550426..9cea87e 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -281,6 +281,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):