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 @@
CHANGES
=======
-----
1.4.1
-----
* Issue #114: Use ``sys.getfilesystemencoding`` for decoding config in
``bdist_wininst`` distributions.
---
1.4
---
......
......@@ -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
......
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