mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-06-22 08:00:31 +00:00
Handle sys.getfilesystemencoding() returning None
This commit is contained in:
parent
5db16141cc
commit
b67f7a8c51
4 changed files with 20 additions and 7 deletions
|
@ -4,14 +4,14 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
|||
##################################################################################################
|
||||
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
import traceback
|
||||
|
||||
from six import ensure_text
|
||||
|
||||
from kodi_six import xbmc, xbmcaddon
|
||||
|
||||
import database
|
||||
from helper import get_filesystem_encoding
|
||||
|
||||
from . import settings
|
||||
|
||||
|
@ -90,7 +90,7 @@ class MyFormatter(logging.Formatter):
|
|||
|
||||
def format(self, record):
|
||||
if record.pathname:
|
||||
record.pathname = ensure_text(record.pathname, sys.getfilesystemencoding())
|
||||
record.pathname = ensure_text(record.pathname, get_filesystem_encoding())
|
||||
|
||||
self._gen_rel_path(record)
|
||||
|
||||
|
@ -104,7 +104,7 @@ class MyFormatter(logging.Formatter):
|
|||
res = []
|
||||
|
||||
for o in traceback.format_exception(*exc_info):
|
||||
o = ensure_text(o, sys.getfilesystemencoding())
|
||||
o = ensure_text(o, get_filesystem_encoding())
|
||||
|
||||
if o.startswith(' File "'):
|
||||
# If this split can't handle your file names, you should seriously consider renaming your files.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue