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

Fix NameError caused by failed import in auto plugin. #1935

Merged
merged 2 commits into from Aug 10, 2015

Conversation

okin
Copy link
Member

@okin okin commented Aug 9, 2015

After upgrading to 7.6.3 I got the following error message:

[2015-08-09T18:01:02Z] ERROR: yapsy: Unable to import plugin: /Users/niko/.virtualenvs/nikola/lib/python3.4/site-packages/nikola/plugins/command/auto
Traceback (most recent call last):
  File "/Users/niko/.virtualenvs/nikola/lib/python3.4/site-packages/yapsy/PluginManager.py", line 485, in loadPlugins
    candidate_module = imp.load_module(plugin_module_name,None,candidate_filepath,("py","r",imp.PKG_DIRECTORY))
  File "/Users/niko/.virtualenvs/nikola/lib/python3.4/imp.py", line 245, in load_module
    return load_package(name, filename)
  File "/Users/niko/.virtualenvs/nikola/lib/python3.4/imp.py", line 217, in load_package
    return methods.load()
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/Users/niko/.virtualenvs/nikola/lib/python3.4/site-packages/nikola/plugins/command/auto/__init__.py", line 443, in <module>
    f = WebSocketWSGIHandler.finish_response
NameError: name 'WebSocketWSGIHandler' is not defined

This was introduced through this fix for #1906: 80a49ad
The introduced WebSocketWSGIHandler may not be available.

This PR avoids crashing the plugin.

@ralsina
Copy link
Member

ralsina commented Aug 10, 2015

Eh? But why would that be available? It's part of a dependency.

@okin
Copy link
Member Author

okin commented Aug 10, 2015

I do not have ws4py installed in this environment and this makes the import fail and get caught.

To trigger the error I just did a "nikola build" and this then seems to fail because the monkey patch is done on module level.

Am 10. August 2015 05:03:03 MESZ, schrieb Roberto Alsina notifications@github.com:

Eh? But why would that be available? It's part of a dependency.


Reply to this email directly or view it on GitHub:
#1935 (comment)

@ralsina
Copy link
Member

ralsina commented Aug 10, 2015

Ah, ok then.

ralsina added a commit that referenced this pull request Aug 10, 2015
Fix NameError caused by failed import in auto plugin.
@ralsina ralsina merged commit bc80cb9 into getnikola:master Aug 10, 2015
@okin okin deleted the fix_websocketwsgihandler_name_error branch September 13, 2015 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants