timbrel / GitSavvy

Full git and GitHub integration with Sublime Text
MIT License
1.9k stars 135 forks source link

AttributeError: module 'sublime' has no attribute 'RegionFlags' #1904

Closed moracca closed 2 months ago

moracca commented 2 months ago

I'm getting the following in the consnole after my SublimeText3 plugin automatically updated itself to 2.44.0

reloading plugin GitSavvy.__init__
reloading plugin GitSavvy.git_savvy
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 312, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.8/importlib/__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 808, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/ldd/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/git_savvy.py", line 3, in <module>
  File "/Users/ldd/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/common/commands/__init__.py", line 1, in <module>
  File "/Users/ldd/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/common/commands/debug.py", line 7, in <module>
  File "/Users/ldd/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/common/util/__init__.py", line 5, in <module>
  File "/Users/ldd/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/common/util/view.py", line 6, in <module>
  File "/Users/ldd/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/view.py", line 6, in <module>
  File "/Users/ldd/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/runtime.py", line 15, in <module>
  File "/Users/ldd/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/utils.py", line 122, in <module>
AttributeError: module 'sublime' has no attribute 'RegionFlags'

none of the gitsavvy shortcuts are showing up in the command palette, gitsavvy appears to not be loading at all.

Any suggestions? I also upgraded mac os x to Sonoma recently, not sure if its related.

kaste commented 2 months ago

RegionFlags is a builtin since Sublime Text v4132 (https://www.sublimetext.com/docs/api_reference.html#sublime.RegionFlags). The previous Sublime version is from Dec 2021.

If you have a new version of ST usually a restart is enough because either Package Control or the hot-reloader just got confused.

I actually did not realize this, t.i. updating the required ST4 version, to be a breaking change because ST4 usually (mine I think) is ever-green in the sense that it updates itself seamlessly.

moracca commented 2 months ago

I see. In order to upgrade ST4 I need a license upgrade, which I haven't gotten around to yet. Do you know if its possible to force the plugin to use a previous version before the requirement change?

moracca commented 2 months ago

I ended up upgrading my license for ST4 💸 and upgrading, gitsavvy is working for me again now. Thanks.

kaste commented 2 months ago

You're right it's not ever-green unless you pay.
To freeze versions you typically install a package manually using git clone https://github.com/timbrel/GitSavvy#less-simple. Then you can checkout any version you like. That's also how you would contribute to GitSavvy and send PR's.