albertosottile / darkdetect

Detect OS Dark Mode from Python
Other
171 stars 18 forks source link

Module produces ValueError on Windows 8.1 #23

Closed UDS-DavidM closed 1 year ago

UDS-DavidM commented 2 years ago

The module incorrectly assumes that the output from platform.release() can be translated into int. This will cause an error on import in Windows 8.1.

Traceback (most recent call last):
  File "<pyshell>", line 1, in <module>
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\darkdetect\__init__.py", line 19, in <module>
    elif sys.platform == "win32" and int(platform.release()) >= 10:
ValueError: invalid literal for int() with base 10: '8.1'

Cheers.

albertosottile commented 1 year ago

This should have been fixed in #21, released in 0.6.0. Do you still experience this bug with the latest version of darkdetect?

albertosottile commented 1 year ago

Closing this as I assume it was fixed by #21, please reopen in case you still experience this issue.