From 63f856f5797afb3497818820f038c00ed10c0518 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 23 Nov 2013 16:39:09 -0500 Subject: Use sys.getfilesystemencoding for decoding bdist_wininst config. Fixes #114. --- setuptools/command/easy_install.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 6ce19fa4..d329f4cb 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1373,10 +1373,9 @@ def extract_wininst_cfg(dist_filename): else: null_byte = chr(0) config = part.split(null_byte, 1)[0] - # Now the config is in bytes, but on Python 3, it must be - # unicode for the RawConfigParser, so decode it. Is this the - # right encoding? - config = config.decode('ascii') + # Now the config is in bytes, but for RawConfigParser, it should + # be text, so decode it. + config = config.decode(sys.getfilesystemencoding()) cfg.readfp(StringIO(config)) except ConfigParser.Error: return None -- cgit v1.2.1