dgtlmoon / changedetection.io

The best and simplest free open source web page change detection, website watcher, restock monitor and notification service. Restock Monitor, change detection. Designed for simplicity - Simply monitor which websites had a text change for free. Free Open source web page change detection, Website defacement monitoring, Price change notification
https://changedetection.io
Apache License 2.0
18.76k stars 1.03k forks source link

macOS native: Python error on macOS: AttributeError: '_UnixSelectorEventLoop' object has no attribute '_signal_handlers' #995

Open wdormann opened 2 years ago

wdormann commented 2 years ago

Describe the bug On macOS, python reports an error any time a notification is triggered / tested:

Exception ignored in: <function BaseEventLoop.__del__ at 0x105a4a790>
Traceback (most recent call last):
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 683, in __del__
    self.close()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/unix_events.py", line 60, in close
    for sig in list(self._signal_handlers):
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_signal_handlers'

Version v0.39.19.1

To Reproduce

Steps to reproduce the behavior:

  1. Install changedetection.io: pip install changedetection.io
  2. Edit a rule
  3. Click the Notifications tab
  4. Enter any valid notification, such as macosx://

Expected behavior Notification works

Desktop (please complete the following information):

dgtlmoon commented 2 years ago

Could you try python 3.8 ?

wdormann commented 2 years ago

Actually, yes, Python 3.8 works! So on macOS, there's some issue with 3.9? My working Linux box is running Python 3.10 fine.

dgtlmoon commented 2 years ago

Can you try 3.9 on linux? i wonder..

wdormann commented 2 years ago

I performed to relevant tests: 1) 3.9 on Linux - Works fine! 2) 3.10 on macOS (installed via MacPorts) - Works fine!

It seems that there's a bug in the Python 3.9 code on macOS (Both the 3.9.6 that comes with macOS Monterey and also the 3.9.13 that MacPorts provides) where '_UnixSelectorEventLoop' object has no attribute '_signal_handlers'

So perhaps not a changedetection.io bug, but a Python 3.9-on-macOS bug? Ideally there would be some way to warn users if they are trying to use such a combination?

dgtlmoon commented 2 years ago

related https://github.com/dgtlmoon/changedetection.io/issues/208

dgtlmoon commented 1 year ago

So only solution is, choose 3.8 or 3.10 but not 3.9 :)

I'll add some feature where it will check if it's Mac and 3.9 and give a warning