{"action":"created","issue":{"url":"https://api.github.com/repos/ActivityWatch/aw-watcher-window/issues/19","repository_url":"https://api.github.com/repos/ActivityWatch/aw-watcher-window","labels_url":"https://api.github.com/repos/ActivityWatch/aw-watcher-window/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/ActivityWatch/aw-watcher-window/issues/19/comments","events_url":"https://api.github.com/repos/ActivityWatch/aw-watcher-window/issues/19/events","html_url":"https://github.com/ActivityWatch/aw-watcher-window/issues/19","id":239431386,"number":19,"title":"Got BadWindow exception while trying to get active window on Linux","user":{"login":"ErikBjare","id":1405370,"avatar_url":"https://avatars0.githubusercontent.com/u/1405370?v=4","gravatar_id":"","url":"https://api.github.com/users/ErikBjare","html_url":"https://github.com/ErikBjare","followers_url":"https://api.github.com/users/ErikBjare/followers","following_url":"https://api.github.com/users/ErikBjare/following{/other_user}","gists_url":"https://api.github.com/users/ErikBjare/gists{/gist_id}","starred_url":"https://api.github.com/users/ErikBjare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErikBjare/subscriptions","organizations_url":"https://api.github.com/users/ErikBjare/orgs","repos_url":"https://api.github.com/users/ErikBjare/repos","events_url":"https://api.github.com/users/ErikBjare/events{/privacy}","received_events_url":"https://api.github.com/users/ErikBjare/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-06-29T10:18:20Z","updated_at":"2017-07-27T03:46:32Z","closed_at":null,"body":"Got this while running aw-watcher-window (commit 7612c4a9377ad9daa274e0242b09d59fba830d7c):\r\n\r\n    2017-06-28 12:36:49,972 [INFO ]: Running watcher with poll time 1.0 seconds  (aw_watcher_window.main:35)            \r\n    2017-06-28 12:36:49,973 [INFO ]: aw-watcher-window has started  (aw_watcher_window.main:43)                         \r\n    2017-06-28 12:36:50,019 [INFO ]: Connection to aw-server established  (aw_client.client:251)                        \r\n    2017-06-28 12:36:50,030 [INFO ]: Loaded 1 failed requests from queuefile  (aw_client.client:236)                    \r\n    2017-06-28 20:43:26,199 [WARNING]: Unable to get window class, got a BadWindow exception.  (root:74)                \r\n\r\n    2017-06-28 20:43:26,199 [WARNING]: Code made an unclear branch  (root:79)                                           \r\n    2017-06-28 20:43:26,202 [ERROR]: Exception thrown while trying to get active window: <class 'Xlib.error.BadWindow'>: code = 3, resource_id = <class 'Xlib.xobject.resource.Resource'>(0x00c00004), sequence_number = 43768, major_opcode = 15, minor_opcode = 0  (aw_watcher_window.main:64)\r\n    Traceback (most recent call last):                        \r\n      File \"/home/erb/Programming/activitywatch/aw-watcher-window/aw_watcher_window/main.py\", line 61, in heartbeat_loop\r\n        current_window = get_current_window()                 \r\n      File \"/home/erb/Programming/activitywatch/aw-watcher-window/aw_watcher_window/lib.py\", line 44, in get_current_window\r\n        return get_current_window_linux()                     \r\n      File \"/home/erb/Programming/activitywatch/aw-watcher-window/aw_watcher_window/lib.py\", line 13, in get_current_window_linux\r\n        cls = xlib.get_window_class(window)                   \r\n      File \"/home/erb/Programming/activitywatch/aw-watcher-window/aw_watcher_window/xlib.py\", line 80, in get_window_class\r\n        window = window.query_tree().parent                   \r\n      File \"/home/erb/Programming/activitywatch/venv_main2/lib/python3.6/site-packages/python_xlib-0.19-py3.6.egg/Xlib/xobject/drawable.py\", line 425, in query_tree\r\n      File \"/home/erb/Programming/activitywatch/venv_main2/lib/python3.6/site-packages/python_xlib-0.19-py3.6.egg/Xlib/protocol/rq.py\", line 1360, in __init__\r\n      File \"/home/erb/Programming/activitywatch/venv_main2/lib/python3.6/site-packages/python_xlib-0.19-py3.6.egg/Xlib/protocol/rq.py\", line 1380, in reply\r\n    Xlib.error.BadWindow: <class 'Xlib.error.BadWindow'>: code = 3, resource_id = <class 'Xlib.xobject.resource.Resource'>(0x00c00004), sequence_number = 43768, major_opcode = 15, minor_opcode = 0\r\n\r\n    During handling of the above exception, another exception occurred:                                                 \r\n\r\n    Traceback (most recent call last):                        \r\n      File \"/usr/lib64/python3.6/runpy.py\", line 193, in _run_module_as_main                                            \r\n        \"__main__\", mod_spec)    \r\n      File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code                                                       \r\n        exec(code, run_globals)  \r\n      File \"aw_watcher_window/__main__.py\", line 3, in <module>                                                         \r\n        main()                   \r\n      File \"/home/erb/Programming/activitywatch/aw-watcher-window/aw_watcher_window/main.py\", line 45, in main          \r\n        heartbeat_loop(client, bucket_id, poll_time=args.poll_time, exclude_title=args.exclude_title)                   \r\n      File \"/home/erb/Programming/activitywatch/aw-watcher-window/aw_watcher_window/main.py\", line 65, in heartbeat_loop\r\n        traceback.print_exc(e)   \r\n      File \"/usr/lib64/python3.6/traceback.py\", line 159, in print_exc                                                  \r\n        print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)                                           \r\n      File \"/usr/lib64/python3.6/traceback.py\", line 100, in print_exception                                            \r\n        type(value), value, tb, limit=limit).format(chain=chain):                                                       \r\n      File \"/usr/lib64/python3.6/traceback.py\", line 497, in __init__                                                   \r\n        capture_locals=capture_locals)                        \r\n      File \"/usr/lib64/python3.6/traceback.py\", line 332, in extract                                                    \r\n        if limit >= 0:           \r\n    TypeError: '>=' not supported between instances of 'BadWindow' and 'int'                                            \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ActivityWatch/aw-watcher-window/issues/comments/318250559","html_url":"https://github.com/ActivityWatch/aw-watcher-window/issues/19#issuecomment-318250559","issue_url":"https://api.github.com/repos/ActivityWatch/aw-watcher-window/issues/19","id":318250559,"user":{"login":"ErikBjare","id":1405370,"avatar_url":"https://avatars0.githubusercontent.com/u/1405370?v=4","gravatar_id":"","url":"https://api.github.com/users/ErikBjare","html_url":"https://github.com/ErikBjare","followers_url":"https://api.github.com/users/ErikBjare/followers","following_url":"https://api.github.com/users/ErikBjare/following{/other_user}","gists_url":"https://api.github.com/users/ErikBjare/gists{/gist_id}","starred_url":"https://api.github.com/users/ErikBjare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErikBjare/subscriptions","organizations_url":"https://api.github.com/users/ErikBjare/orgs","repos_url":"https://api.github.com/users/ErikBjare/repos","events_url":"https://api.github.com/users/ErikBjare/events{/privacy}","received_events_url":"https://api.github.com/users/ErikBjare/received_events","type":"User","site_admin":false},"created_at":"2017-07-27T03:46:32Z","updated_at":"2017-07-27T03:46:32Z","body":"It seems we could work around this issue by catching XError's and retrying. \r\n\r\nSee xlib source here: https://github.com/python-xlib/python-xlib/blob/master/Xlib/error.py"}}
{"actor":{"display_login":"ErikBjare"}}