zSeriesGuy / Tautulli

A Python based monitoring and tracking tool for Plex Media Server.
http://tautulli.com
GNU General Public License v3.0
27 stars 9 forks source link

Telegram notification fails #24

Closed prinzpi closed 4 years ago

prinzpi commented 4 years ago

Hi, I'm facing the issue, that the notification for telegram is not working. Error Log:

    Tautulli NotificationHandler :: Notification thread exception: can't concat bytes to str
Traceback (most recent call last):
    File "/opt/Tautulli/plexpy/notification_handler.py", line 55, in process_queue
        notify(**params)
    File "/opt/Tautulli/plexpy/notification_handler.py", line 366, in notify
        **kwargs)
    File "/opt/Tautulli/plexpy/notifiers.py", line 645, in send_notification
        **kwargs)
    File "/opt/Tautulli/plexpy/notifiers.py", line 825, in notify
        return self.agent_notify(subject=subject, body=body, action=action, **kwargs)
    File "/opt/Tautulli/plexpy/notifiers.py", line 3404, in agent_notify
        text = subject.encode('utf-8') + '\r\n' + body.encode('utf-8')
TypeError: can't concat bytes to str

Seems to be related to the same issue which has been already discussed / solved here: https://github.com/zSeriesGuy/Tautulli/issues/21

Specs: Tautulli: V4.0.08 Python: 3.5.2 Server: Ubuntu 16.04.6 LTS

Do I need to upgrade to python 3.8? Thanks for helping.

Regards.

zSeriesGuy commented 4 years ago

With the migration to Python 3, I'm sure I missed a lot of str vs. bytes encoding issues, especially with functions that I don't use and haven't tested, like many of the notifiers.

I just pushed a fix. Let me know if it resolves the issue. Thanks for reporting.

prinzpi commented 4 years ago

I just pushed a fix. Let me know if it resolves the issue. Thanks for reporting.

Thanks as always for the fast responding & fix. It's working now. Have a nice day.