1

Calling this statement causes AutoKey to crash and require a full restart, it happens randomly.

targetScan = window.get_active_title()
  • Autokey: 0.96.0-beta.5
  • Python: 3.10.4

It used to work reliably I think on an older version of Python. If I figure it out, I'll update this.

This is nearly identical to Autokey: sporadic error on system.exec_command, but with Python3.10. I was getting it rather frequently but discovered I had a Windows Python module installed, removed that, and now I'm down to 1 out 3 times it will fail me. I wonder if there is a way to scan the Python modules to find out which ones belong to a type of operating system; for example, windows only.

Also my output in case someone wants to help us out

2022-05-26 10:40:59,608 ERROR - autokey.service - Script error
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/autokey/service.py", line 530, in _execute
    exec(compiled_code, scope)
  File "/home/kreezxil/.config/autokey/data/_work/curseforge/projects/mymods.py", line 22, in <module>
    targetScan = window.get_active_title()
  File "/usr/lib/python3.10/site-packages/autokey/scripting/window.py", line 230, in get_active_title
    return self.mediator.interface.get_window_title()
  File "/usr/lib/python3.10/site-packages/autokey/interface.py", line 1225, in get_window_title
    return self.get_window_info(window, traverse).wm_title
  File "/usr/lib/python3.10/site-packages/autokey/interface.py", line 1141, in get_window_info
    return self._get_window_info(window, traverse)
  File "/usr/lib/python3.10/site-packages/autokey/interface.py", line 1147, in _get_window_info
    new_wm_title = self._try_get_window_title(window)
  File "/usr/lib/python3.10/site-packages/autokey/interface.py", line 1197, in _try_get_window_title
    atom = self._try_read_property(window, self.__NameAtom)
  File "/usr/lib/python3.10/site-packages/autokey/interface.py", line 1212, in _try_read_property
    return window.get_property(property_name, 0, 0, 255)
  File "/home/kreezxil/.local/lib/python3.10/site-packages/Xlib/xobject/drawable.py", line 435, in get_property
    r = request.GetProperty(display = self.display,
  File "/home/kreezxil/.local/lib/python3.10/site-packages/Xlib/protocol/rq.py", line 1481, in __init__
    self.reply()
  File "/home/kreezxil/.local/lib/python3.10/site-packages/Xlib/protocol/rq.py", line 1493, in reply
    self._display.send_and_recv(request = self._serial)
  File "/home/kreezxil/.local/lib/python3.10/site-packages/Xlib/protocol/display.py", line 556, in send_and_recv
    gotreq = self.parse_response(request)
  File "/home/kreezxil/.local/lib/python3.10/site-packages/Xlib/protocol/display.py", line 643, in parse_response
    gotreq = self.parse_request_response(request) or gotreq
  File "/home/kreezxil/.local/lib/python3.10/site-packages/Xlib/protocol/display.py", line 726, in parse_request_response
    raise RuntimeError("Expected reply for request %s, but got %s.  Can't happen!"
RuntimeError: Expected reply for request 617, but got 616.  Can't happen!

Kreezxil
  • 11
  • 4
  • Since the time that I posted this, I have moved on to a new computer and reloaded my Manjaro Linux on to it. I'm also on both a newer version of AutoKey and Python. The issue is no longer appearing after reinstating the code. I'm not sure what to do about this. It should be noted AutoKey has a funny versioning system as I'm on 0.96.0 now and my Python is 3.11.3 too. I was considering deleting this but thought, what's the point, maybe someone else runs into this problem and realizes they need to upgrade to fix it. – Kreezxil Jun 12 '23 at 12:49

0 Answers0