You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The KeypressHandler-thread crashes if a phrase expansion is triggered by a hotkey, and then is undone using the backspace key.
Steps to Reproduce
Assign an abbreviation to trick the checking logic.
Assign a hotkey to a phrase
Press the hotkey to expand the phrase
Press backspace to undo the expansion operation
Expected Results
Pasted/typed phrase should disappear
Actual Results
2018-07-06 10:17:04,670 INFO - service - Undoing last abbreviation expansion
Exception in thread KeypressHandler-thread:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/thomas/Projekte/autokey/lib/autokey/iomediator/_iomediator.py", line 114, in run
target.handle_keypress(rawKey, modifiers, key, windowName, windowClass)
File "/home/thomas/Projekte/autokey/lib/autokey/service.py", line 180, in handle_keypress
if self.__updateStack(key):
File "/home/thomas/Projekte/autokey/lib/autokey/service.py", line 277, in __updateStack
self.phraseRunner.undo_expansion()
File "/home/thomas/Projekte/autokey/lib/autokey/service.py", line 416, in undo_expansion
replay = self.lastPhrase.get_trigger_chars(self.lastBuffer)
File "/home/thomas/Projekte/autokey/lib/autokey/model.py", line 822, in get_trigger_chars
stringBefore, typedAbbr, stringAfter = self._partition_input(buffer, abbr)
File "/home/thomas/Projekte/autokey/lib/autokey/model.py", line 249, in _partition_input
stringBefore, typedAbbr, stringAfter = currentString.rpartition(abbr)
TypeError: must be str, not NoneType
Version
AutoKey version 0.95.1
Notes
It seems that "lastBuffer" contains the trigger abbreviation that was removed during expansion. This does not exist when using a hotkey, thus is not initialized.
Possible solutions:
Initialize with an empty string (""), so that the logic does not break with TypeErrors
Specifically handle this situation and skip the code, which is not needed in this case.
The text was updated successfully, but these errors were encountered:
Classification:
Crash
Reproducibility:
Always
Summary
The KeypressHandler-thread crashes if a phrase expansion is triggered by a hotkey, and then is undone using the backspace key.
Steps to Reproduce
backspace
to undo the expansion operationExpected Results
Actual Results
Version
AutoKey version 0.95.1
Notes
It seems that "lastBuffer" contains the trigger abbreviation that was removed during expansion. This does not exist when using a hotkey, thus is not initialized.
Possible solutions:
The text was updated successfully, but these errors were encountered: