phuhl / notify-send.py

A python-script like libnotify but with improved functionality
Other
95 stars 13 forks source link

TypeError when using --replaces-process #19

Closed rjekker closed 3 years ago

rjekker commented 3 years ago

I'm trying to use notify-send.py with i3-volume (https://github.com/hastinbe/i3-volume/issues). It calls your script as follows (in my configuration):

notify-send.py --hint int:value:0 string:synchronous:volume string:x-canonical-private-synchronous:volume string:image-path:audio-volume-low-symbolic boolean:transient:true -t 1500 -i audio-volume-low-symbolic --replaces-process volume Volume   0%

Which causes the following error:

Traceback (most recent call last):
  File "/home/reindert/.local/lib/python3.7/site-packages/notify_send_py/notify_send_py.py", line 126, in notify
    conn = Client(pidf.read())
  File "/usr/lib/python3.7/multiprocessing/connection.py", line 487, in Client
    family = family or address_type(address)
  File "/usr/lib/python3.7/multiprocessing/connection.py", line 108, in address_type
    raise ValueError('address type of %r unrecognized' % address)
ValueError: address type of b'' unrecognized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/reindert/.local/bin/notify-send.py", line 8, in <module>
    sys.exit(main())
  File "/home/reindert/.local/lib/python3.7/site-packages/notify_send_py/notify_send_py.py", line 218, in main
    NotifySendPyCLI()
  File "/home/reindert/.local/lib/python3.7/site-packages/notify_send_py/notify_send_py.py", line 211, in __init__
    dontQuitOnAction=args.dontQuitOnAction
  File "/home/reindert/.local/lib/python3.7/site-packages/notify_send_py/notify_send_py.py", line 132, in notify
    pidf.write(listener.address)
TypeError: a bytes-like object is required, not 'str'

When I leave out --replaces-process, the error does not occur.

Using python3.7.3 on Debian Buster.

hastinbe commented 3 years ago

Fixed in https://github.com/phuhl/notify-send.py/commit/99415b4ea64cd201bcb2e93b28459b2dac2c5ab8