Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easy_install quits with "error: None" in setuptools 1.1.6 #89

Closed
ghost opened this issue Oct 15, 2013 · 5 comments
Closed

easy_install quits with "error: None" in setuptools 1.1.6 #89

ghost opened this issue Oct 15, 2013 · 5 comments

Comments

@ghost
Copy link

ghost commented Oct 15, 2013

Originally reported by: mgedmin (Bitbucket: mgedmin, GitHub: mgedmin)


$ virtualenv env
$ env/bin/pip install -U setuptools
$ env/bin/easy_install --version
setuptools 1.1.6

$ env/bin/easy_install zc.buildout==1.7.1
error: None

I wouldn't mind too much (env/bin/pip exists after all), but zc.buildout uses easy_install to bootstrap itself, so this error means I cannot bootstrap any buildouts on this box.

Other interesting commands that fail:

$ env/bin/easy_install zc.buildout
error: None

$ env/bin/easy_install
error: None

Meanwhile easy_install --help works.

The OS here is Ubuntu 11.10 "Natty", which is no longer supported by Canonical and should be upgraded ASAP. I cannot reproduce this bug on Ubuntu 12.04 LTS or Ubuntu 10.04 LTS servers.


@ghost
Copy link
Author

ghost commented Oct 16, 2013

Original comment by mgedmin (Bitbucket: mgedmin, GitHub: mgedmin):


More details: bootstrap.py works when run with /usr/bin/python2.7 (it downloads setuptools-0.6c11 and then upgrades setuptools to 1.1.6), but fails when run with a virtualenv python that already has setuptools 1.1.6. (It also fails with a virtualenv that doesn't have setuptools upgraded to 1.1.6, but with a different error, which is irrelevant to this particular issue.)

@ghost
Copy link
Author

ghost commented Oct 20, 2013

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Hi Marius. I looked into trying to replicate the issue, but I don't find a vagrant image for Natty on vagrantboxes nor on Rackspace. As a result, it would be quite involved for me to track down the issue.

I apologize that the error message isn't more helpful. That error is raised in distutils.core:169, seemingly from an error that renders as the string "None". I've seen this for example when the .pypirc config file has incorrect settings (and causes a urlparse to raise an error whose value is None, which later is wrapped in a DistutilsError).

I know there some issues with earlier versions of pip (prior to 1.4) and upgrading setuptools, so that may play a factor as well. You may try upgrading virtualenv/pip before upgrading setuptools.

Beyond that, however, the best I can suggest is that you fire up a debugger and trace the code to find out what's triggering the error. I wish I could be of more help, but the obscure environment means you'll have to do the bulk of the work to localize and characterize the issue to suggest a cause and patch.

@ghost
Copy link
Author

ghost commented Oct 21, 2013

Original comment by mgedmin (Bitbucket: mgedmin, GitHub: mgedmin):


To put this in a bit of perspective: I don't care that latest easy_install doesn't work in a virtualenv on Ubuntu Natty. I care about the useless error message. I assume the bug where the error message gets lost is still present in the latest setuptools, it's just that this old Natty system happens to provide a way to reproduce it.

cd env && bin/python -m trace --trace bin/easy_install

ends with this:

sysconfig.py(227):     with open(filename) as f:
sysconfig.py(306):     except IOError, e:
sysconfig.py(307):         msg = "invalid Python installation: unable to open %s" % makefile
sysconfig.py(308):         if hasattr(e, "strerror"):
sysconfig.py(309):             msg = msg + " (%s)" % e.strerror
sysconfig.py(310):         raise IOError(msg)
core.py(153):         except KeyboardInterrupt:
core.py(155):         except (IOError, os.error), exc:
core.py(156):             error = grok_environment_error(exc)
 --- modulename: util, funcname: grok_environment_error
util.py(301):     if hasattr(exc, 'filename') and hasattr(exc, 'strerror'):
util.py(302):         if exc.filename:
util.py(307):             error = prefix + "%s" % exc.strerror
util.py(311):     return error
core.py(158):             if DEBUG:
core.py(162):                 raise SystemExit, error
easy_install.py(1914):             distutils.core.gen_usage = old_gen_usage
 --- modulename: trace, funcname: _unsettrace
trace.py(80):         sys.settrace(None)

and strace -e open ends with

open("/tmp/env3/lib/python2.7/distutils/distutils.cfg", O_RDONLY) = 3
open("/tmp/env3/local/lib/python2.7/config/Makefile", O_RDONLY) = -1 ENOENT (No such file or directory)

which makes it clearer what the problem is (virtualenv 1.4.9 fails to create the 'local' subdir in the environment).

AFAICS the error message gets lost in distutils.util.grok_environment_error, since IOError('a message').strerror is None. So, it's not a bug in setuptools.

@ghost
Copy link
Author

ghost commented Oct 21, 2013

Original comment by mgedmin (Bitbucket: mgedmin, GitHub: mgedmin):


Reported distutils bug at http://bugs.python.org/issue19333

@ghost
Copy link
Author

ghost commented Mar 12, 2014

Original comment by Merwok (Bitbucket: Merwok, GitHub: Merwok):


FYI upstream issue (http://bugs.python.org/issue4931 —19333 was a duplicate) will be fixed in 2.7.7, 3.3.6 and 3.4.1. People can test the fix now using the Mercurial versions.

@ghost ghost closed this as completed Mar 29, 2016
jaraco added a commit that referenced this issue Dec 24, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants