JulianEberius / SublimePythonIDE

ST3 only: A rewrite of SublimeRope for ST3, uses the Rope library to add python completions and refactoring to ST3
GNU General Public License v2.0
267 stars 38 forks source link

Exception in generate_color_scheme_async #72

Closed amyreese closed 8 years ago

amyreese commented 9 years ago

I'm using the Base16 Color Schemes package to provide my preferred color scheme in Sublime, and when I installed SublimePythonIDE from package control, it generates this exception in the console:

Traceback (most recent call last):
  File "/home/jreese/profile/dotfiles/sublime3/Packages/SublimePythonIDE/sublime_python_colors.py", line 104, in generate_color_scheme_async
    color = color.lstrip('#')
AttributeError: 'NoneType' object has no attribute 'lstrip'
Traceback (most recent call last):
  File "/home/jreese/profile/dotfiles/sublime3/Packages/SublimePythonIDE/sublime_python_colors.py", line 116, in generate_color_scheme_async
    with open(scheme_path, 'w', encoding='utf8') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/jreese/profile/dotfiles/sublime3/Packages/Base16 Color Schemes/base16-tomorrow.dark.tmTheme'

The theme does not exist in this path because Sublime doesn't extract packages at runtime anymore.

autumnjolitz commented 9 years ago

Affected by this error as wel

JulianEberius commented 9 years ago

Thanks for the report. Should be fixed in new version 1.0.1 Feel free to reopen if the problem persists after updating.

amyreese commented 9 years ago

Package Control shows version 1.0.1 as installed, but when I restart Sublime, I still get a similar error (except without the lstrip exception):

https://gist.github.com/jreese/f3fab4857f8bc69923fe

autumnjolitz commented 9 years ago

This issue is not closed -- new Sublime Text 3 installs are affected by this.

It appears ST3 is no longer placing it's themes inside Packages/ directory.

BenedictKing commented 9 years ago

V1.0.1 still has this issue.

JulianEberius commented 9 years ago

I'm looking into it as soon as possible.

JulianEberius commented 9 years ago

Hopefully fixed in new version 1.0.2. I switched to using the same solution as SublimeLinter, which is writing out a modified version of the currently used theme to "Packages/User" instead of modifying the user's theme in-place, which is not possible if the theme resides in an unextracted package.

This is not a great solution by the way, as it unexpectedly changes user settings, and also breaks updates of the original theme the user probably installed via Package Control (the theme will still update, but changes will not propagate to the version modified by SublimePythonIDE). If anyone can come up with a better idea, I would be glad to hear it. For now the SublimeLinter solution must be enough.