[Python-checkins] distutils2: Kludge around shlex not supporting unicode in 2.x (#13170).

eric.araujo python-checkins at python.org
Wed Oct 19 21:08:00 CEST 2011


http://hg.python.org/distutils2/rev/cda119958db3
changeset:   1214:cda119958db3
parent:      1212:5d858149df06
user:        Éric Araujo <merwok at netwok.org>
date:        Wed Oct 19 03:08:13 2011 +0200
summary:
  Kludge around shlex not supporting unicode in 2.x (#13170).

Thanks to David Barnett for the diagnosis.

files:
  distutils2/config.py |  6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/distutils2/config.py b/distutils2/config.py
--- a/distutils2/config.py
+++ b/distutils2/config.py
@@ -43,9 +43,11 @@
             continue
         fields.append(tmp_vals[0])
     # Get bash options like `gcc -print-file-name=libgcc.a` XXX bash options?
-    vals = split(' '.join(fields))
+    # kludge around shlex not supporting unicode
+    vals = u' '.join(fields).encode('utf-8')
+    vals = split(vals)
     if vals:
-        return vals
+        return [val.decode('utf-8') for val in vals]
 
 
 def _rel_path(base, path):

-- 
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list