toprekt2 / autokey

Automatically exported from code.google.com/p/autokey
GNU General Public License v3.0
0 stars 0 forks source link

clipboard.get_selection crashes Autokey #197

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Version 0.90.3
2. Create a "Minimum" test sript:

contents = clipboard.get_selection()
keyboard.send_keys(contents)

3. Run the test script

What is the expected output? What do you see instead?

Expect: The clipboard is pasted.
See: Crash

What version of the product are you using? On what operating system?
0.90.3
Ubuntu 11.10

Please provide any additional information below.

Similar to reports:
http://code.google.com/p/autokey/issues/detail?id=40&can=1&q=get_selection
http://code.google.com/p/autokey/issues/detail?id=107&can=1&q=get_selection

but this happens all the time, no matter in which window I use the script, and 
I am sure I am selecting latin-only chars.

Stack trace:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 454, in execute
    exec script.code in scope
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/autokey/scripting.py", line 820, in get_selection
    self.__execAsync(self.selection.request_text, self.__receive)
  File "/usr/lib/python2.7/dist-packages/autokey/scripting.py", line 865, in __execAsync
    callback(*args)
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in function
    return info.invoke(*args, **kwargs)
TypeError: request_text() takes exactly 3 arguments (2 given)

Original issue reported on code.google.com by ciro.san...@gmail.com on 5 May 2012 at 7:05

GoogleCodeExporter commented 8 years ago
Any chance you can test this on Ubuntu 12.04?

Original comment by cdekter on 7 May 2012 at 9:25

GoogleCodeExporter commented 8 years ago
After upgrade to 12.04, I still get the same.

Ah, I also noticed that only the interface crashes, because after the interface 
crash, my existing phrases are still getting expanded.

2012-05-09 02:18:18,140 DEBUG - service - Ignored locking error in 
handle_keypress
2012-05-09 02:18:18,141 DEBUG - service - Script runner executing: 
Script('Abbreviation from selection')
2012-05-09 02:18:18,320 DEBUG - iomediator - <shift> released
2012-05-09 02:18:18,344 DEBUG - iomediator - <ctrl> released
2012-05-09 02:18:18,393 ERROR - service - Script error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 454, in execute
    exec script.code in scope
  File "<string>", line 3, in <module>
  File "/usr/lib/python2.7/dist-packages/autokey/scripting.py", line 820, in get_selection
    self.__execAsync(self.selection.request_text, self.__receive)
  File "/usr/lib/python2.7/dist-packages/autokey/scripting.py", line 865, in __execAsync
    callback(*args)
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in function
    return info.invoke(*args, **kwargs)
TypeError: request_text() takes exactly 3 arguments (2 given)
2012-05-09 02:18:20,171 DEBUG - service - Received mouse click - resetting 
buffer

Original comment by ciro.san...@gmail.com on 9 May 2012 at 7:21

GoogleCodeExporter commented 8 years ago
I had just upgraded to 12.04 from 11.10, but after removing everything and with 
a clean 12.04 install, the problem was gone.

If no one duplicates this on a clean Ubuntu 12.04 install, this can be closed.

Original comment by ciro.san...@gmail.com on 10 May 2012 at 5:14

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This is due to different behaviours in Gnome 3.2 and 3.4 of PyGI. I will try to 
fix but it's not a priority as it works in the latest GTK versions.

Original comment by cdekter on 15 May 2012 at 2:27

GoogleCodeExporter commented 8 years ago
Fixed for next release

Original comment by cdekter on 15 May 2012 at 10:53

GoogleCodeExporter commented 8 years ago
Honestly thank you.

Original comment by trankvil...@gmail.com on 15 May 2012 at 12:20

GoogleCodeExporter commented 8 years ago
hi, with Ubuntu 12.10 the problem persists,
according to 
http://stackoverflow.com/questions/10804576/python-gtk-clipboard-get-gtk3-return
-value-differs

I've tried to remove decode('utf8') call and it works.
scripting.py +837

regards berga

Original comment by marco.be...@gmail.com on 5 Dec 2012 at 7:57

Attachments:

GoogleCodeExporter commented 8 years ago
I'm sorry, the problem is related to the fix of the issue #211

2012-12-05 23:27:40,255 ERROR - service - Script error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 454, in execute
    exec script.code in scope
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/autokey/scripting.py", line 837, in fill_clipboard
    self.clipBoard.set_text(contents.decode('utf8'))
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
TypeError: set_text() takes exactly 3 arguments (2 given)

so it seems to work restoring last param "-1" to set_text call.

Original comment by marco.be...@gmail.com on 5 Dec 2012 at 10:29

GoogleCodeExporter commented 8 years ago
Any chance this could be fixed by the October 17th release of Ubuntu 13.10?

Here's a downstream bug report listed on launchpad:
https://bugs.launchpad.net/autokey/+bug/1075429

Original comment by lonnie...@startport.com on 7 Oct 2013 at 10:14