Commit 63f856f5 authored by Jason R. Coombs's avatar Jason R. Coombs

Use sys.getfilesystemencoding for decoding bdist_wininst config. Fixes #114.

parent 52197867
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
CHANGES CHANGES
======= =======
-----
1.4.1
-----
* Issue #114: Use ``sys.getfilesystemencoding`` for decoding config in
``bdist_wininst`` distributions.
--- ---
1.4 1.4
--- ---
......
...@@ -1373,10 +1373,9 @@ def extract_wininst_cfg(dist_filename): ...@@ -1373,10 +1373,9 @@ def extract_wininst_cfg(dist_filename):
else: else:
null_byte = chr(0) null_byte = chr(0)
config = part.split(null_byte, 1)[0] config = part.split(null_byte, 1)[0]
# Now the config is in bytes, but on Python 3, it must be # Now the config is in bytes, but for RawConfigParser, it should
# unicode for the RawConfigParser, so decode it. Is this the # be text, so decode it.
# right encoding? config = config.decode(sys.getfilesystemencoding())
config = config.decode('ascii')
cfg.readfp(StringIO(config)) cfg.readfp(StringIO(config))
except ConfigParser.Error: except ConfigParser.Error:
return None return None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment