Here is the minimal code to reproduce the issue.
from notifypy import Notify
n = Notify(enable_logging=True)
n.send()
The above code snippet results in the following notification on Arch Linux.

While the output in stdout shows the following:
2023-12-03 21:22:11.679 | INFO | notifypy.notify:__init__:50 - Logging is enabled.
2023-12-03 21:22:11.685 | INFO | notifypy.os_notifiers.linux:<module>:16 - libnotify found, using it for notifications
2023-12-03 21:22:11.685 | DEBUG | notifypy.os_notifiers.linux:<module>:28 - aplay binary not installed.. audio will not work!
2023-12-03 21:22:11.686 | DEBUG | notifypy.os_notifiers.linux:send_notification:74 - Generated command: ['/usr/bin/notify-send', 'Default Title', 'Default Message', "--icon='/home/white/study/SDM404/Assessment 3/SDM404 Final Project/venv/lib/python3.11/site-packages/notifypy/py-logo.png'", "--app-name='Python Application (notify.py)'", '-u', 'normal']
2023-12-03 21:22:11.704 | INFO | notifypy.notify:send_notification:351 - Sent notification.
It is because of unnecessary extra quotation while calling:
|
|
|
if notification_icon: |
|
generated_command.append(f"--icon={shlex.quote(notification_icon)}") |
|
|
According to the subprocess documentation, it takes over argument quotation if needed. After a small correction it works like a charm.
if notification_icon:
generated_command.extend(['--icon', notification_icon])
if kwargs.get("application_name"):
generated_command.extend(['--app-name', kwargs.get('application_name')])

2023-12-03 21:25:46.435 | INFO | notifypy.notify:__init__:50 - Logging is enabled.
2023-12-03 21:25:46.441 | INFO | notifypy.os_notifiers.linux:<module>:16 - libnotify found, using it for notifications
2023-12-03 21:25:46.441 | DEBUG | notifypy.os_notifiers.linux:<module>:28 - aplay binary not installed.. audio will not work!
2023-12-03 21:25:46.441 | DEBUG | notifypy.os_notifiers.linux:send_notification:72 - Generated command: ['/usr/bin/notify-send', 'Default Title', 'Default Message', '--icon', '/home/white/study/SDM404/Assessment 3/SDM404 Final Project/venv/lib/python3.11/site-packages/notifypy/py-logo.png', '--app-name', 'Python Application (notify.py)', '-u', 'normal']
2023-12-03 21:25:46.457 | INFO | notifypy.notify:send_notification:351 - Sent notification.
Here is the minimal code to reproduce the issue.
The above code snippet results in the following notification on Arch Linux.

While the output in stdout shows the following:
It is because of unnecessary extra quotation while calling:
notify-py/notifypy/os_notifiers/linux.py
Lines 62 to 65 in 0c09c6b
According to the subprocess documentation, it takes over argument quotation if needed. After a small correction it works like a charm.