summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-06-17 16:33:11 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2016-06-17 16:33:11 (GMT)
commit99d66f917a60ad556726b497a7d964e4b2ce109d (patch)
treef177f6a9d89d686b1d1a671b8a71a4a45be94e56 /Lib/distutils/tests
parentd7292b5e9f7e0cd227032370bb6c46a39c252f38 (diff)
parent08bb8a41cc976343795bd0e241cd7388e9f44ad5 (diff)
downloadcpython-99d66f917a60ad556726b497a7d964e4b2ce109d.zip
cpython-99d66f917a60ad556726b497a7d964e4b2ce109d.tar.gz
cpython-99d66f917a60ad556726b497a7d964e4b2ce109d.tar.bz2
Issue #27048: Prevents distutils failing on Windows when environment variables contain non-ASCII characters
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r--Lib/distutils/tests/test_msvccompiler.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_msvccompiler.py b/Lib/distutils/tests/test_msvccompiler.py
index c4d911f..4dc2488 100644
--- a/Lib/distutils/tests/test_msvccompiler.py
+++ b/Lib/distutils/tests/test_msvccompiler.py
@@ -83,6 +83,24 @@ class msvccompilerTestCase(support.TempdirManager,
self.assertFalse(os.path.isfile(os.path.join(
tempdir, os.path.basename(dll))))
+ def test_get_vc_env_unicode(self):
+ import distutils._msvccompiler as _msvccompiler
+
+ test_var = 'ṰḖṤṪ┅ṼẨṜ'
+ test_value = '₃⁴₅'
+
+ # Ensure we don't early exit from _get_vc_env
+ old_distutils_use_sdk = os.environ.pop('DISTUTILS_USE_SDK', None)
+ os.environ[test_var] = test_value
+ try:
+ env = _msvccompiler._get_vc_env('x86')
+ self.assertIn(test_var.lower(), env)
+ self.assertEqual(test_value, env[test_var.lower()])
+ finally:
+ os.environ.pop(test_var)
+ if old_distutils_use_sdk:
+ os.environ['DISTUTILS_USE_SDK'] = old_distutils_use_sdk
+
def test_suite():
return unittest.makeSuite(msvccompilerTestCase)