paste method freezes autokey-gtk in Ubuntu 14.04

Bug #1460255 reported by Rob
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
autokey (Ubuntu)
Fix Released
Undecided
Thomas

Bug Description

In a fresh install of Ubuntu 14.04.2 LTS, the autokey-gtk application (0.94.1-4) crashes when the paste method is used. This causes keyboard input to freeze in the application where the autokey was used, and if typed again, in all applications. Here is the debug output from using the autokey twice in gedit (the traceback is after the first time, and autokey-gtk was killed after the second time to get input back in all applications):

2015-05-30 00:34:46,019 DEBUG - interface - Grabbing hotkey: [u'<shift>', u'<super>'] u'k'
2015-05-30 00:34:46,019 DEBUG - interface - Grabbing hotkey: [u'<shift>', u'<super>'] u'k'
2015-05-30 00:34:46,019 DEBUG - interface - Grabbing hotkey: [u'<ctrl>'] u'<f7>'
2015-05-30 00:34:53,340 DEBUG - service - Received mouse click - resetting buffer
2015-05-30 00:34:55,201 DEBUG - service - Received mouse click - resetting buffer
2015-05-30 00:34:57,020 DEBUG - service - Raw key: u';', modifiers: [], Key: ;
2015-05-30 00:34:57,020 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:34:57,020 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:34:57,020 DEBUG - service - Input stack at end of handle_keypress: [u';']
2015-05-30 00:34:57,191 DEBUG - service - Raw key: u';', modifiers: [], Key: ;
2015-05-30 00:34:57,191 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:34:57,191 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:34:57,191 DEBUG - service - Input stack at end of handle_keypress: [u';', u';']
2015-05-30 00:34:57,518 DEBUG - service - Raw key: u's', modifiers: [], Key: s
2015-05-30 00:34:57,518 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:34:57,518 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:34:57,519 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's']
2015-05-30 00:34:57,684 DEBUG - service - Raw key: u'h', modifiers: [], Key: h
2015-05-30 00:34:57,684 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:34:57,684 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:34:57,684 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's', u'h']
2015-05-30 00:34:57,942 DEBUG - service - Raw key: u'r', modifiers: [], Key: r
2015-05-30 00:34:57,942 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:34:57,942 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:34:57,942 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's', u'h', u'r']
2015-05-30 00:34:58,062 DEBUG - service - Raw key: u'u', modifiers: [], Key: u
2015-05-30 00:34:58,062 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:34:58,062 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:34:58,063 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's', u'h', u'r', u'u']
2015-05-30 00:34:58,279 DEBUG - service - Raw key: u'g', modifiers: [], Key: g
2015-05-30 00:34:58,279 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:34:58,279 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:34:58,279 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's', u'h', u'r', u'u', u'g']
2015-05-30 00:34:59,826 DEBUG - service - Raw key: '<enter>', modifiers: [], Key: <enter>
2015-05-30 00:34:59,826 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:34:59,826 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:34:59,827 DEBUG - service - Input stack at end of handle_keypress: []
2015-05-30 00:34:59,827 DEBUG - service - Ignored locking error in handle_keypress
2015-05-30 00:34:59,827 DEBUG - iomediator - Send via clipboard
2015-05-30 00:34:59,827 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:34:59,835 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:34:59,836 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:34:59,836 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:34:59,836 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:34:59,852 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:34:59,853 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:34:59,853 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:34:59,864 DEBUG - interface - Sending string: u'\xaf\\(\u30c4)/\xaf'
2015-05-30 00:34:59,870 ERROR - interface - Error in X event loop thread
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autokey/interface.py", line 116, in __eventLoop
    method(*args)
  File "/usr/lib/python2.7/dist-packages/autokey/interface.py", line 500, in __sendStringClipboard
    self.__fillClipboard(string)
  File "/usr/lib/python2.7/dist-packages/autokey/interface.py", line 537, in __fillClipboard
    self.clipBoard.set_text(string.encode("utf-8"))
TypeError: set_text() takes exactly 3 arguments (2 given)
2015-05-30 00:35:03,646 DEBUG - service - Raw key: u';', modifiers: [], Key: ;
2015-05-30 00:35:03,646 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:35:03,646 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:35:03,647 DEBUG - service - Input stack at end of handle_keypress: [u';']
2015-05-30 00:35:03,816 DEBUG - service - Raw key: u';', modifiers: [], Key: ;
2015-05-30 00:35:03,817 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:35:03,817 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:35:03,817 DEBUG - service - Input stack at end of handle_keypress: [u';', u';']
2015-05-30 00:35:04,596 DEBUG - service - Raw key: u's', modifiers: [], Key: s
2015-05-30 00:35:04,596 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:35:04,596 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:35:04,597 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's']
2015-05-30 00:35:04,763 DEBUG - service - Raw key: u'h', modifiers: [], Key: h
2015-05-30 00:35:04,763 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:35:04,763 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:35:04,763 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's', u'h']
2015-05-30 00:35:04,931 DEBUG - service - Raw key: u'r', modifiers: [], Key: r
2015-05-30 00:35:04,931 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:35:04,931 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:35:04,931 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's', u'h', u'r']
2015-05-30 00:35:05,067 DEBUG - service - Raw key: u'u', modifiers: [], Key: u
2015-05-30 00:35:05,067 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:35:05,067 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:35:05,067 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's', u'h', u'r', u'u']
2015-05-30 00:35:05,250 DEBUG - service - Raw key: u'g', modifiers: [], Key: g
2015-05-30 00:35:05,250 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:35:05,250 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:35:05,251 DEBUG - service - Input stack at end of handle_keypress: [u';', u';', u's', u'h', u'r', u'u', u'g']
2015-05-30 00:35:06,240 DEBUG - service - Raw key: '<enter>', modifiers: [], Key: <enter>
2015-05-30 00:35:06,241 DEBUG - service - Window visible title: u'*Untitled Document 1 - gedit', Window class: u'gedit.Gedit'
2015-05-30 00:35:06,241 DEBUG - service - No phrase/script matched hotkey
2015-05-30 00:35:06,241 DEBUG - service - Input stack at end of handle_keypress: []
2015-05-30 00:35:06,241 DEBUG - service - Ignored locking error in handle_keypress
2015-05-30 00:35:06,241 DEBUG - iomediator - Send via clipboard
2015-05-30 00:35:06,241 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:35:06,241 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:35:06,242 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:35:06,250 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:35:06,250 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:35:06,250 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:35:06,251 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:35:06,267 DEBUG - interface - Send special key: ['<backspace>']
2015-05-30 00:35:06,267 DEBUG - interface - Sending string: u'\xaf\\(\u30c4)/\xaf'
Aborted (core dumped)

This appears to be related to https://code.google.com/p/autokey/issues/detail?id=211

Patch to resolve the issue in Ubuntu 14.04.2 LTS is attached, but there may be more places where set_text() is not passed the appropriate number of arguments:

$ grep -Hrn "set_text(" /usr/lib/python2.7/dist-packages/autokey/ | wc -l
37

Tags: patch
Revision history for this message
Rob (truthsolo) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "autokey_paste_fix.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in autokey (Ubuntu):
status: New → Confirmed
Revision history for this message
Thomas (tux12345) wrote :

The »TypeError: set_text() takes exactly 3 arguments (2 given)«
was caused by a GTK2 to GTK3 port and is fixed for the general case in
https://github.com/autokey/autokey/commit/572316bd17f4c45dc38ca149962ca176865a2f2a and fully in
https://github.com/autokey/autokey/commit/d6efe4edfb81eeb2300f8a67f210d845a56188f9
This bug triggered another bug (https://github.com/autokey/autokey/issues/72) in broken X11 keyboard grabbing logic (symptom: keyboard input lock), which is fixed in
https://github.com/autokey/autokey/commit/0afdb9770f614ecb9f848b03b180d537cfe975bc

Those commits are part of version 0.95.1, resolving this issue when Ubuntu packages version >= 0.95.1.

Revision history for this message
Thomas (tux12345) wrote :

This issue is fixed in 0.95.9, which is part of Ubuntu 20.04

Changed in autokey (Ubuntu):
assignee: nobody → Thomas (tux12345)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.