'NoneType' object has no attribute 'endswith'
joeshaw opened this issue · comments
I recently started getting the following error trying to do installs with pip-accel. I don't hardcode the version of pip-accel I install, so it might be something introduced in a recent release, but I haven't narrowed it down yet:
2014-01-09 19:30:46 build01 pip-accel[19661] INFO Unpacked local source distributions in 3.81 seconds.
Traceback (most recent call last):
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/bin/pip-accel", line 9, in <module>
load_entry_point('pip-accel==0.11.2', 'console_scripts', 'pip-accel')()
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/lib/python2.6/site-packages/pip_accel/__init__.py", line 99, in main
requirements = unpack_source_dists(arguments, build_directory)
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/lib/python2.6/site-packages/pip_accel/__init__.py", line 177, in unpack_source_dists
return sorted([Requirement(r) for r in requirement_set.requirements.values()],
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/lib/python2.6/site-packages/pip_accel/req.py", line 46, in __init__
self.old_interface = (self.name, self.version, self.source_directory)
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/lib/python2.6/site-packages/pip_accel/req.py", line 80, in version
return self.pip_requirement.installed_version
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/lib/python2.6/site-packages/pip/req.py", line 390, in installed_version
return self.pkg_info()['version']
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/lib/python2.6/site-packages/pip/req.py", line 359, in pkg_info
logger.warn('No PKG-INFO file found in %s' % display_path(self.egg_info_path('PKG-INFO')))
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/lib/python2.6/site-packages/pip/req.py", line 306, in egg_info_path
base = os.path.join(self.source_dir, 'pip-egg-info')
File "/home/buildbot/jenkins/workspace/gemstone-server-integration-prod/gemstone-server/virtualenv/lib/python2.6/posixpath.py", line 67, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
pip is version 1.4.1, which I've been using for a while. And although the exception is down in pip itself, if I replace pip-accel in my script with pip, it works fine.
I've tried nuking my ~/.pip-accel directory but that didn't work. Any other ideas?
Hi Joe and thanks for the feedback!
For a while there I wasn't able to reproduce this, but a colleague of mine recently ran into this problem and this allowed me to attach a debugger to find out exactly what was going on (thanks @Menollo).
Long story short, I introduced a bug in pip-accel 0.11 where it would fail on pip-accel install distribute
and/or pip-accel install setuptools
(equivalent commands really) but only when the already installed version of distribute/setuptools is recent enough within the Python environment... On my hosts I have an older version of setuptools installed so I never noticed this issue.
Given the above information I was able to reproduce the problem and confirm that it's fixed in pip-accel 0.11.7 so I'm fairly certain this problem is now resolved. This is why I'm closing this issue. If you're still seeing the problem feel free to reopen this issue or create a new one.