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

from six.moves import urllib fails on Red Hat python2 #218

Closed
bmr-cymru opened this issue Nov 14, 2013 · 1 comment
Closed

from six.moves import urllib fails on Red Hat python2 #218

bmr-cymru opened this issue Nov 14, 2013 · 1 comment

Comments

@bmr-cymru
Copy link
Member

There's a problem importing urllib via six.moves on Red Hat based distros with a python2 runtime:

$ sudo sosreport -v --batch
Traceback (most recent call last):
  File "/sbin/sosreport", line 19, in <module>
    from sos.sosreport import main
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 40, in <module>
    from sos.plugins import import_plugin
  File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 41, in <module>
    from six.moves import urllib, zip, filter
ImportError: cannot import name urllib

However, nothing in the plugins directory actually uses urllib - it seems to be a leftover from the removal of the JBoss/EAP plug-ins which used it for URL handling.

The remaining six imports (zip, filter) appear to work as expected - for now the simplest solution is to drop the urllib import.

bmr-cymru added a commit that referenced this issue Nov 14, 2013
The urllib import via six.moves in the plugins module is unused.
This causes an exception on some distributions when attempting to
import the moved module.

Drop the import since nothing in the plugin classes is using it.

Fixes Issue #218

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
@adam-stokes
Copy link

this Fixes #218

ddstreet pushed a commit to ddstreet/sos that referenced this issue Apr 15, 2016
The urllib import via six.moves in the plugins module is unused.
This causes an exception on some distributions when attempting to
import the moved module.

Drop the import since nothing in the plugin classes is using it.

Fixes Issue sosreport#218

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants