diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2011-07-25 17:51:23 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2011-07-25 17:51:23 -0400 |
commit | b4aecb449c912f0b405c687c763b9976c4cd884d (patch) | |
tree | 046e44e305586c6e3175a151013bb6592090fd26 | |
parent | e63f3e7d864b26529d6b197e053b4084be20decf (diff) | |
download | external_python_setuptools-b4aecb449c912f0b405c687c763b9976c4cd884d.tar.gz external_python_setuptools-b4aecb449c912f0b405c687c763b9976c4cd884d.tar.bz2 external_python_setuptools-b4aecb449c912f0b405c687c763b9976c4cd884d.zip |
Fix issue where easy_install fails on Python 3 on windows installer. Fixes #212
--HG--
branch : distribute
extra : rebase_source : 1920a8d261fa7918d9d3813a104cf2ed11878c7c
-rw-r--r-- | distribute.egg-info/entry_points.txt | 2 | ||||
-rwxr-xr-x | setuptools/command/easy_install.py | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/distribute.egg-info/entry_points.txt b/distribute.egg-info/entry_points.txt index 1c9f123d..9fd41758 100644 --- a/distribute.egg-info/entry_points.txt +++ b/distribute.egg-info/entry_points.txt @@ -32,7 +32,7 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete [console_scripts] easy_install = setuptools.command.easy_install:main -easy_install-2.6 = setuptools.command.easy_install:main +easy_install-2.7 = setuptools.command.easy_install:main [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 58e7ab39..c1bae1c0 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1425,7 +1425,16 @@ def extract_wininst_cfg(dist_filename): f.seek(prepended-(12+cfglen)) cfg = ConfigParser.RawConfigParser({'version':'','target_version':''}) try: - cfg.readfp(StringIO.StringIO(f.read(cfglen).split(chr(0),1)[0])) + part = f.read(cfglen) + # part is in bytes, but we need to read up to the first null + # byte. + null_byte = bytes([0]) if sys.version_info >= (2,6) else chr(0) + config, = part.split(null_byte, 1) + # 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') + cfg.readfp(StringIO.StringIO(config)) except ConfigParser.Error: return None if not cfg.has_section('metadata') or not cfg.has_section('Setup'): |