summaryrefslogtreecommitdiff
path: root/tests/test_msvccompiler.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-06-17 09:32:38 -0700
committerSteve Dower <steve.dower@microsoft.com>2016-06-17 09:32:38 -0700
commit7b9d0828be06389c7e81946ba049231396eb9f3d (patch)
tree8af8b621059fe1333ddeb3bb134c2cc291c5fc7f /tests/test_msvccompiler.py
parent7c3fafbc0017fa29a42d0eda69b37b37c4b465c2 (diff)
downloadpython-setuptools-git-7b9d0828be06389c7e81946ba049231396eb9f3d.tar.gz
Issue #27048: Prevents distutils failing on Windows when environment variables contain non-ASCII characters
Diffstat (limited to 'tests/test_msvccompiler.py')
-rw-r--r--tests/test_msvccompiler.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_msvccompiler.py b/tests/test_msvccompiler.py
index c4d911ff..4dc24886 100644
--- a/tests/test_msvccompiler.py
+++ b/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)