phuhl / notify-send.py

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

--replaces-process throws exception in multiprocessing #24

Open GregPK opened 9 months ago

GregPK commented 9 months ago

Script runs fine in all other cases, but running with --replaces-process on my machine like so:

notify-send.py --replaces-process testrep "Test replaces"

causes:

Traceback (most recent call last):
  File "/home/gregpk/.local/pipx/venvs/notify-send-py/lib/python3.11/site-packages/notify_send_py/notify_send_py.py", line 126, in notify
    conn = Client(pidf.read())
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/connection.py", line 513, in Client
    family = family or address_type(address)
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/connection.py", line 109, 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/gregpk/.local/bin/notify-send.py", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/gregpk/.local/pipx/venvs/notify-send-py/lib/python3.11/site-packages/notify_send_py/notify_send_py.py", line 218, in main
    NotifySendPyCLI()
  File "/home/gregpk/.local/pipx/venvs/notify-send-py/lib/python3.11/site-packages/notify_send_py/notify_send_py.py", line 199, in __init__
    n_id = NotifySendPy().notify(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gregpk/.local/pipx/venvs/notify-send-py/lib/python3.11/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'
TimP4w commented 8 months ago

I have the same issue (Python 3.11.6)

                   -`                    timp4w@arch 
                  .o+`                   ----------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Kernel: 6.6.8-arch1-1 
               `+oooooo:                 Uptime: 3 hours, 22 mins 
               -+oooooo+:                Packages: 1018 (pacman), 12 (flatpak) 
             `/:-:++oooo+:               Shell: zsh 5.9 
            `/++++/+++++++:              Resolution: 2560x1440 
           `/++++++++++++++:             DE: Hyprland 
          `/+++ooooooooooooo/`           WM: sway 
         ./ooosssso++osssssso+`          Terminal: kitty 
        .oossssso-````/ossssss+`         CPU: Intel i7-9700K (8) @ 4.900GHz 
       -osssssso.      :ssssssso.        GPU: NVIDIA GeForce RTX 2070 Rev. A 
      :osssssss/        osssso+++.       Memory: 3620MiB / 32015MiB 
     /ossssssss/        +ssssooo/-
   `/ossssso+/:-        -:/+osssso+-                             
  `+sso+:-`                 `.-/+oso:                            
 `++:.                           `-/+/
 .`                                 `/
tetsugakusha256 commented 7 months ago

Same issue here on arch too. Python 3.11.6 Installed notify-send.py through AUR where notify-send-py has Version: 1.2.7-1

phuhl commented 7 months ago

Unfortunately I don't have time to work on a fix, currently. But PR is always welcome

Qu4tro commented 5 months ago

This is fixed on main actually. It just needs a new release.

vincentaxhe commented 4 months ago

notify-send is capable of replace id now, as long as in a loop. use -p to emit id, -r to replace id. I give up using notify-send.py with my deadd-notification, only volume notification is not ideal。

ArchWand commented 3 months ago

notify-send is capable of replace id now, as long as in a loop. use -p to emit id, -r to replace id. I give up using notify-send.py with my deadd-notification, only volume notification is not ideal。

Thank you so much, I was pulling my hair out over this