summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2014-02-20 15:56:22 -0500
committerDonald Stufft <donald@stufft.io>2014-02-20 15:56:22 -0500
commitaeeb33e2158664b72e1c593a9ade4a751007b64d (patch)
tree02c21de6fcf2230d654d6d99c85867d804600feb
parent6ae7e8fec60a5fe6f55a14be0beb94b7bb8629e2 (diff)
downloadpip-aeeb33e2158664b72e1c593a9ade4a751007b64d.tar.gz
Don't pass a unicode __file__ to setup.py on Python 2.x
-rw-r--r--CHANGES.txt3
-rw-r--r--pip/req.py6
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 3c8789d20..66f650b9a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -19,6 +19,9 @@ Changelog
* Workaround for Python bug http://bugs.python.org/issue20053 (PR #1544)
+* Don't pass a unicode __file__ to setup.py on Python 2.x (PR #1583)
+
+
1.5.2 (2014-01-26)
------------------
diff --git a/pip/req.py b/pip/req.py
index b0ea10aa3..e9ea20f3b 100644
--- a/pip/req.py
+++ b/pip/req.py
@@ -33,7 +33,7 @@ from pip.download import (PipSession, get_file_content, is_url, url_to_path,
unpack_file_url, unpack_http_url)
import pip.wheel
from pip.wheel import move_wheel_files, Wheel, wheel_ext
-from pip._vendor import pkg_resources
+from pip._vendor import pkg_resources, six
def read_text_file(filename):
@@ -280,6 +280,10 @@ class InstallRequirement(object):
else:
setup_py = os.path.join(self.source_dir, setup_file)
+ # Python2 __file__ should not be unicode
+ if six.PY2 and isinstance(setup_py, six.text_type):
+ setup_py = setup_py.encode(sys.getfilesystemencoding())
+
return setup_py
def run_egg_info(self, force_root_egg_info=False):