dreadatour / Flake8Lint

Sublime Text plugin for lint Python files
233 stars 58 forks source link

ImportError: No module named elementtree #67

Closed dreadatour closed 9 years ago

dreadatour commented 9 years ago

@carlos-jenkins: Well well well... this update broke the plugin again :(

Here the debug info from console:

Reloading plugin /home/jenkins/.config/sublime-text-2/Packages/Python Flake8 Lint/Flake8Lint.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./Flake8Lint.py", line 20, in <module>
    from color_theme import update_color_scheme
  File "./color_theme.py", line 18, in <module>
    from elementtree import SimpleXMLTreeBuilder
ImportError: No module named elementtree
Reloading plugin /home/jenkins/.config/sublime-text-2/Packages/Python Flake8 Lint/color_theme.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./color_theme.py", line 18, in <module>
    from elementtree import SimpleXMLTreeBuilder
ImportError: No module named elementtree

https://github.com/dreadatour/Flake8Lint/commit/a078cb1bc15e2531808c8a0012d34b9afda05738#commitcomment-9403423

dreadatour commented 9 years ago

@carlos-jenkins Fix was added, could you, please, check it?

carlos-jenkins commented 9 years ago

@dreadatour And we are back online!

Replacing ~/.config/sublime-text-2/Packages/Python Flake8 Lint/[lint.py/color_theme.py] with the ones patched fixed the issue.

Just a minor warning is printed in console:

Reloading plugin /home/jenkins/.config/sublime-text-2/Packages/Python Flake8 Lint/Flake8Lint.py
./contrib/elementtree/SimpleXMLTreeBuilder.py:60: DeprecationWarning: The xmllib module is obsolete.  Use xml.sax instead.
  import xmllib
[Flake8Lint DEBUG] plugin was loaded

Thanks again for the great support and awesome tool :D

dreadatour commented 9 years ago

Thank you :)

This is OK, this is fallback to old module, used instead of python-expat, so DeprecationWarning is fine. Here is a discussion: https://github.com/dreadatour/Flake8Lint/issues/64

Could you, please, check if lint is OK?

carlos-jenkins commented 9 years ago

@dreadatour everything is working as expected:

screenshot from 2015-01-22 14 20 17

Thanks!

dreadatour commented 9 years ago

Great, thank you!

But... I see at least one problem here :) Ruler guide is set to 80 characters and long lines are highlighted from 79 characters.

You can try new feature, if you want: "ruler_guide". It is automatically setup ruler guide for Python files, depend on your lint "max line length" settings.