This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Jarek.Śmiejczak, ncoghlan, vinay.sajip, vstinner
Date 2014-01-06.10:47:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1389005249.59.0.446911344726.issue20140@psf.upfronthosting.co.za>
In-reply-to
Content
> https://gist.github.com/jarekps/2729ee1917ea372e6642

Copy of the output:
---
C:\Users\Jarosław>pip
Traceback (most recent call last):
File "c:\python27\Scripts\pip-script.py", line 9, in <module>
load_entry_point('pip==1.5', 'console_scripts', 'pip')()
File "c:\python27\lib\site-packages\distribute-0.6.49-py2.7.egg\pkg_resources.py", line 345, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\python27\lib\site-packages\distribute-0.6.49-py2.7.egg\pkg_resources.py", line 2381, in load_entry_point
return ep.load()
File "c:\python27\lib\site-packages\distribute-0.6.49-py2.7.egg\pkg_resources.py", line 2087, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "c:\python27\lib\site-packages\pip\__init__.py", line 11, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "c:\python27\lib\site-packages\pip\vcs\subversion.py", line 4, in <module>
from pip.index import Link
File "c:\python27\lib\site-packages\pip\index.py", line 16, in <module>
from pip.wheel import Wheel, wheel_ext, wheel_setuptools_support
File "c:\python27\lib\site-packages\pip\wheel.py", line 23, in <module>
from pip._vendor.distlib.scripts import ScriptMaker
File "c:\python27\lib\site-packages\pip\_vendor\distlib\scripts.py", line 15, in <module>
from .resources import finder
File "c:\python27\lib\site-packages\pip\_vendor\distlib\resources.py", line 105, in <module>
cache = Cache()
File "c:\python27\lib\site-packages\pip\_vendor\distlib\resources.py", line 40, in __init__
base = os.path.join(get_cache_base(), 'resource-cache')
File "c:\python27\lib\ntpath.py", line 108, in join
path += "\\" + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 14: ordinal not in range(128)
---

It looks like a bug in distlib.resources, not in Python.

os.path.join() works correctly if all arguments are bytes strings (str type). I should work if all arguments are Unicode strings only containing ASCII characters. (I don't know if it works if all aruments are Unicode strings.)

In your case, it looks like os.path.join() is called with a unicode and a bytes string.
History
Date User Action Args
2014-01-06 10:47:29vstinnersetrecipients: + vstinner, vinay.sajip, ncoghlan, Jarek.Śmiejczak
2014-01-06 10:47:29vstinnersetmessageid: <1389005249.59.0.446911344726.issue20140@psf.upfronthosting.co.za>
2014-01-06 10:47:29vstinnerlinkissue20140 messages
2014-01-06 10:47:28vstinnercreate