Foxboron / ClojureDoc-Search

Sublime Text Plugin to browse clojuredocs
2 stars 2 forks source link

KeyError: 'ClojureDoc-Search.py3k.builder' #4

Closed gornostal closed 10 years ago

gornostal commented 10 years ago

Hi,

Do you support this plugin? It seems very useful for me, but it crashes with the exception. Maybe you can help with this.

reloading plugin ClojureDocSearch.__init__
reloading plugin ClojureDocSearch.cljdocs
LOL
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "./importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/home/sanya/.config/sublime-text-3/Packages/ClojureDocSearch/cljdocs.py", line 44, in <module>
    from .py3k import BeautifulSoup
  File "/home/sanya/.config/sublime-text-3/Packages/ClojureDocSearch/py3k/__init__.py", line 29, in <module>
    from .builder import builder_registry
  File "/home/sanya/.config/sublime-text-3/Packages/ClojureDocSearch/py3k/builder/__init__.py", line 305, in <module>
    register_treebuilders_from(_htmlparser)
  File "/home/sanya/.config/sublime-text-3/Packages/ClojureDocSearch/py3k/builder/__init__.py", line 289, in register_treebuilders_from
    this_module = sys.modules['ClojureDoc-Search.py3k.builder']
KeyError: 'ClojureDoc-Search.py3k.builder'
reloading plugin ClojureDocSearch.edit
Foxboron commented 10 years ago

Hey man. Yes i still support this package. I just havent tested it very well on ST3. I'll go right ahead and debug this.

Foxboron commented 10 years ago

There is still a bug when you choose to "View Examples", but i believe the import issue should be resolved now.

gornostal commented 10 years ago

Great! It works. Thanks a lot.

Although, when I installed it via Package Control, I got this error:

found 1 files for base name Default.sublime-theme
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 680, in update_compressed_packages
    multi_importer.loaders = [ZipLoader(p) for p in pkgs]
  File "/opt/sublime_text/sublime_plugin.py", line 680, in <listcomp>
    multi_importer.loaders = [ZipLoader(p) for p in pkgs]
  File "/opt/sublime_text/sublime_plugin.py", line 588, in __init__
    z = zipfile.ZipFile(zippath, 'r')
  File "./zipfile.py", line 919, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/home/sanya/.config/sublime-text-3/Installed Packages/ClojureDocSearch.sublime-package'
reloading Packages/User/Package Control.sublime-settings
reloading plugin ClojureDocSearch.__init__
reloading plugin ClojureDocSearch.cljdocs
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "./importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/home/sanya/.config/sublime-text-3/Packages/ClojureDocSearch/cljdocs.py", line 44, in <module>
    from .py3k import BeautifulSoup
  File "/home/sanya/.config/sublime-text-3/Packages/ClojureDocSearch/py3k/__init__.py", line 29, in <module>
    from .builder import builder_registry
  File "/home/sanya/.config/sublime-text-3/Packages/ClojureDocSearch/py3k/builder/__init__.py", line 304, in <module>
    from . import _htmlparser
ImportError: cannot import name _htmlparser

After I rebooted Sublime Text, plugin appears to be working fine.

Foxboron commented 10 years ago

@gornostal i suspect it got something with how Sublime handles the package and reload them. Aslong as the error dosnt persist i don't really think its worth looking into.

gornostal commented 10 years ago

Agree.

Foxboron commented 10 years ago

@gornostal, i'll be pushing a fix for View Examples as Sublime text uses a retarded assumption when determining the lenght of the given elements. If you experience this problem, a fix is a few min away.

gornostal commented 10 years ago

@Foxboron I don't see issues with View Examples, but that's nice you have fixed them so fast. Thanks again.

Foxboron commented 10 years ago

@gornostal, its in some very specefic cases the bug appears

Foxboron commented 10 years ago

Pushed bugfix for View Examples. Feel free to post any bugs you may encounter in the future!

gornostal commented 10 years ago

OK. Thanks