ms7m / notify-py

:speech_balloon: | A simple Python Module for sending cross-platform desktop notifications on Windows, macOS and Linux
MIT License
262 stars 26 forks source link

fix: UnsupportedPlatform exception on Windows 11 and Python 3.12 #55

Closed TransparentLC closed 5 months ago

TransparentLC commented 1 year ago

It seems that platform.release() will return '11' on Windows 11 instead of '10' in Python 3.12, which leads to an unexpected UnsupportedPlatform exception. I created this PR to fix the detection code.

moham3dk commented 9 months ago

Why hasn't this been merged yet😭

TransparentLC commented 9 months ago

@mohamed-khettab

My temporary fix:

import notifypy
import functools
notifypy.Notify._selected_notification_system = functools.partial(notifypy.Notify._selected_notification_system, override_windows_version_detection=True)

Reference:

https://github.com/ms7m/notify-py/blob/0c09c6b76cbe941c394798c4c4c838d5840b3bb5/notifypy/notify.py#L112-L125

moham3dk commented 9 months ago

@TransparentLC Will give it a try later. Thank you ☺️

BerserkWolfS commented 7 months ago

@TransparentLC Thanks for the temporary fix, I tested it and it is working again in my environment !

ramsy0dev commented 5 months ago

@ms7m Would you please merge this PR to fix the issue with UnsupportedPlatform exception on Windows 11 when using Python 3.12

ms7m commented 5 months ago

I'll merge + publish in the latest changes this weekend.

I'll be near my computer with my PyPi keys then.

ms7m commented 5 months ago

v0.3.43 has been published containing this fix!