jisaacks / GitGutter

A Sublime Text 2/3 plugin to see git diff in gutter
MIT License
3.88k stars 225 forks source link

'NoneType' object has no attribute 'set_timeout' #559

Closed brownsugar closed 3 years ago

brownsugar commented 3 years ago

Description

Sometimes GitGutter does not work, like it's completely disabled, no blames for code and no git status in status bar (while status_bar_text is set). Most error messages I got in the console:

Traceback (most recent call last):
  File "/Users/**/Library/Application Support/Sublime Text 3/Packages/GitGutter/modules/events.py", line 209, in worker
    self.start_timer(self.delay)
  File "/Users/**/Library/Application Support/Sublime Text 3/Packages/GitGutter/modules/events.py", line 218, in start_timer
    print(sublime.set_timeout)
AttributeError: 'NoneType' object has no attribute 'set_timeout'

Here's another one:

Exception in thread Thread-1172:
Traceback (most recent call last):
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/tasks.py", line 65, in run
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/tasks.py", line 23, in run
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/handler.py", line 806, in task_fn
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/promise.py", line 137, in resolve_fn
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/promise.py", line 149, in _do_resolve
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/promise.py", line 107, in callback_wrapper
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/commands.py", line 169, in <lambda>
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/handler.py", line 152, in repository_name
AttributeError: 'NoneType' object has no attribute 'path'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/tasks.py", line 67, in run
AttributeError: 'NoneType' object has no attribute 'print_exc'

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1325, in is_enabled_
    ret = self.is_enabled(**args)
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/commands.py", line 101, in is_enabled
  File "/Users/**/Library/Application Support/Sublime Text 3/Installed Packages/GitGutter.sublime-package/modules/handler.py", line 164, in work_tree
AttributeError: 'NoneType' object has no attribute 'realpath'

Support Info

ConvertToUTF8 is not installed.

Steps to Reproduce Issue

No steps, just opened Sublime text regularly, but sometimes it works.

deathaxe commented 3 years ago

All those tracebacks have one thing in common. They indicate functions from imported python modules not being available. The first one for instance says sublime.set_timeout() wouldn't exist and so the others point to similar issues.

Are there certain situations when that happens. Does it happen directly after startup or while ST has been running for a while already?

I don't see such issues on Windows with exactly the same setup. ST 4096 (4097 now) GitGutter 1.11.3.

Not sure what's going on as those functions should be availbe forever once the library was imported.