Skip to content

BrokenPipeError not correctly handled #127

@oneindelijk

Description

@oneindelijk

I get this error when using pynput (it completely crashes my X)

Exception in thread Thread-4481:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/Xlib/protocol/display.py", line 584, in send_and_recv
    i = self.socket.send(self.data_send)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/site-packages/pynput/_util/__init__.py", line 136, in run
    self._run()
  File "/usr/lib/python3.7/site-packages/pynput/keyboard/_xorg.py", line 499, in _run
    super(Listener, self)._run()
  File "/usr/lib/python3.7/site-packages/pynput/_util/xorg.py", line 401, in _run
    self._suppress_stop(dm)
  File "/usr/lib/python3.7/contextlib.py", line 119, in __exit__
    next(self.gen)
  File "/usr/lib/python3.7/site-packages/pynput/_util/xorg.py", line 74, in display_manager
    display.sync()
  File "/usr/lib/python3.7/site-packages/Xlib/display.py", line 182, in sync
    self.get_pointer_control()
  File "/usr/lib/python3.7/site-packages/Xlib/display.py", line 833, in get_pointer_control
    return request.GetPointerControl(display = self.display)
  File "/usr/lib/python3.7/site-packages/Xlib/protocol/rq.py", line 1369, in __init__
    self.reply()
  File "/usr/lib/python3.7/site-packages/Xlib/protocol/rq.py", line 1381, in reply
    self._display.send_and_recv(request = self._serial)
  File "/usr/lib/python3.7/site-packages/Xlib/protocol/display.py", line 586, in send_and_recv
    self.close_internal('server: %s' % err[1])
TypeError: 'BrokenPipeError' object is not subscriptable

So the exception mightbe something from pynput or that I'm doing wrong,
but the exception following the exception seems to be in
/usr/lib/python3.7/site-packages/Xlib/protocol/display.py", line 586

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions