caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
10.91k stars 384 forks source link

Pin paho-mqtt version < 2.0.0 #1065

Closed caronc closed 4 months ago

caronc commented 4 months ago

Description:

Related issue (if applicable): n/a

MQTT v2 appears to be non-backwards-compatible with it's predecessor. This is causing the following error to appear in a lot of new services that require it.

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 874, in del
self._reset_sockets()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1133, in _reset_sockets
self._sock_close()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1119, in _sock_close
if not self._sock:
AttributeError: 'Client' object has no attribute '_sock'

Apprise has been reported to be impacted here . Best work-around would be to make sure systems do not leverage the new paho-mqtt version; the official bug report is here: eclipse/paho-mqtt/814

Checklist

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@mqtt-avoid-v2-for-now

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  "mqtt://credentials"
codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (5de9b7b) 99.27% compared to head (d46f625) 99.27%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1065 +/- ## ======================================= Coverage 99.27% 99.27% ======================================= Files 136 136 Lines 17738 17738 Branches 3618 3618 ======================================= Hits 17610 17610 Misses 119 119 Partials 9 9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.