Add Python 3.12 and fix Radarr handling (#1989)

* Added Python3.12 and future 3.13

* Fix Radarr result handling

* remove py2.7 and py3.7 support
This commit is contained in:
Clinton Hall 2024-02-28 15:47:04 +13:00 committed by GitHub
parent b802aca7e1
commit f98d6fff65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
173 changed files with 17498 additions and 21001 deletions

View file

@ -1,12 +1,10 @@
import unicodedata
import sys
from setuptools.extern import six
# HFS Plus uses decomposed UTF-8
def decompose(path):
if isinstance(path, six.text_type):
if isinstance(path, str):
return unicodedata.normalize('NFD', path)
try:
path = path.decode('utf-8')
@ -20,10 +18,10 @@ def decompose(path):
def filesys_decode(path):
"""
Ensure that the given path is decoded,
NONE when no expected encoding works
``None`` when no expected encoding works
"""
if isinstance(path, six.text_type):
if isinstance(path, str):
return path
fs_enc = sys.getfilesystemencoding() or 'utf-8'
@ -35,6 +33,8 @@ def filesys_decode(path):
except UnicodeDecodeError:
continue
return None
def try_encode(string, enc):
"turn unicode encoding into a functional routine"