n1k0 / SublimeHighlight

A humble SublimeText package for exporting highlighted code as RTF or HTML
https://github.com/n1k0/SublimeHighlight
MIT License
788 stars 105 forks source link

TypeError while loading package in sublime3 #56

Open kressi opened 9 years ago

kressi commented 9 years ago

Installed SublimeHighlight from https://github.com/n1k0/SublimeHighlight/tree/python3 and get following error when package is loading. https://github.com/n1k0/SublimeHighlight does not work either, ends with error Package desktop missing.

It is installed on Sublime3, running on Linux.

reloading plugin SublimeHighlight.SublimeHighlight
Traceback (most recent call last):
  File "/opt/sublime_text_3/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/michael/.config/sublime-text-3/Packages/SublimeHighlight/SublimeHighlight.py", line 17, in <module>
    if desktop.get_desktop() == 'Windows':
  File "/home/michael/.config/sublime-text-3/Packages/SublimeHighlight/HighlightLib/desktop/__init__.py", line 167, in get_desktop
    elif _is_xfce():
  File "/home/michael/.config/sublime-text-3/Packages/SublimeHighlight/HighlightLib/desktop/__init__.py", line 138, in _is_xfce
    return _readfrom(_get_x11_vars() + "xprop -root _DT_SAVE_MODE", shell=1).strip().endswith(' = "xfce4"')
TypeError: endswith first arg must be bytes or a tuple of bytes, not str
RubenPHP commented 9 years ago

Same error here. I've submited a pull request with the fix. You can see the fix here: https://github.com/n1k0/SublimeHighlight/pull/57/files

kressi commented 9 years ago

Thank you, this fixed my problem.

I just realised, also with pull request https://github.com/n1k0/SublimeHighlight/pull/53/files the issue will no longer occur.