SafeEyes
SafeEyes copied to clipboard
SafeEyes 2.1.2 fails with 'NoneType' object is not subscriptable
On Ubuntu 20.10 64-bit with SafeEyes 2.1.2 installed through PPA I get following error on startup:
Traceback (most recent call last):
File "/usr/bin/safeeyes", line 9, in <module>
load_entry_point('safeeyes==2.1.2', 'console_scripts', 'safeeyes')()
File "/usr/lib/python3/dist-packages/safeeyes/__main__.py", line 147, in main
safe_eyes = SafeEyes(system_locale, config)
File "/usr/lib/python3/dist-packages/safeeyes/safeeyes.py", line 95, in __init__
self.safe_eyes_core.initialize(self.config)
File "/usr/lib/python3/dist-packages/safeeyes/core.py", line 78, in initialize
self.break_queue = BreakQueue(config, self.context)
File "/usr/lib/python3/dist-packages/safeeyes/model.py", line 110, in __init__
current_break = self.get_break()
File "/usr/lib/python3/dist-packages/safeeyes/model.py", line 118, in get_break
self.__current_break = self.next()
File "/usr/lib/python3/dist-packages/safeeyes/model.py", line 135, in next
break_obj = self.__next_short()
File "/usr/lib/python3/dist-packages/safeeyes/model.py", line 178, in __next_short
longs[self.__current_long].time -= shorts[self.__current_short].time
TypeError: 'NoneType' object is not subscriptable
Used to work with 2.1.1
Can you share your cat ~/.config/safeeyes/safeeyes.json
?
Don't you have long breaks?
No need for the safeeyes.json. I am able to reproduce the error and fixed it with https://github.com/slgobinath/SafeEyes/commit/bd4be002e12eb55b508b35fdf48ed606866ff0fb
I'd appreciate it if you could run from source and confirm the fix. I will release asap. Until then, I'd recommend switching back to the 2.1.1 or adding at least one long break to avoid this error.
I have the same issue and I can confirm that this commit fixes it 🎉