mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-06 21:21:12 -07:00
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:
parent
b802aca7e1
commit
f98d6fff65
173 changed files with 17498 additions and 21001 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue