python-discord-rpc icon indicating copy to clipboard operation
python-discord-rpc copied to clipboard

BrokenPipeError: [Errno 32] Broken pipe

Open SIGSTACKFAULT opened this issue 7 years ago • 1 comments

Traceback (most recent call last):
  File "./linux-rpc.py", line 21, in <module>
    rpc_obj.set_activity(activity)
  File "/home/connor/linux-rpc/rpc.py", line 138, in set_activity
    self.send(data)
  File "/home/connor/linux-rpc/rpc.py", line 117, in send
    self._write(data_bytes)
  File "/home/connor/linux-rpc/rpc.py", line 201, in _write
    self._sock.sendall(data)
BrokenPipeError: [Errno 32] Broken pipe

What should I do, catch this error and do rpc.DiscordIpcClient.for_platform(app_id) again?

SIGSTACKFAULT avatar Jun 25 '18 16:06 SIGSTACKFAULT

...And I think I've figured out how to fix it!

$ diff rpc.py rpc_fix.py
116,117c116
<         self._write(header)
<         self._write(data_bytes)
---
>         self._write(header + data_bytes)

SIGSTACKFAULT avatar Jun 25 '18 19:06 SIGSTACKFAULT