]> granicus.if.org Git - python/commitdiff
avoid putting unicode objects in the environment causing
authorMark Hammond <mhammond@skippinet.com.au>
Thu, 18 Sep 2008 03:51:46 +0000 (03:51 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Thu, 18 Sep 2008 03:51:46 +0000 (03:51 +0000)
later test failures.  As discussed on #python-dev

Lib/distutils/msvc9compiler.py

index 0b27428d0515e6cd7d4c36574fb8191ffc252b01..804f1751ceb262905cd7366c6eb764e5c7d11341 100644 (file)
@@ -357,9 +357,10 @@ class MSVCCompiler(CCompiler) :
 
             vc_env = query_vcvarsall(VERSION, plat_spec)
 
-            self.__paths = vc_env['path'].split(os.pathsep)
-            os.environ['lib'] = vc_env['lib']
-            os.environ['include'] = vc_env['include']
+            # take care to only use strings in the environment.
+            self.__paths = vc_env['path'].encode('mbcs').split(os.pathsep)
+            os.environ['lib'] = vc_env['lib'].encode('mbcs')
+            os.environ['include'] = vc_env['include'].encode('mbcs')
 
             if len(self.__paths) == 0:
                 raise DistutilsPlatformError("Python was built with %s, "