mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-20 00:05:07 +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
|
@ -6,6 +6,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
|||
import binascii
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import unicodedata
|
||||
from uuid import uuid4
|
||||
|
@ -488,3 +489,15 @@ class JsonDebugPrinter(object):
|
|||
|
||||
def __str__(self):
|
||||
return json.dumps(self.data, indent=4)
|
||||
|
||||
|
||||
def get_filesystem_encoding():
|
||||
enc = sys.getfilesystemencoding()
|
||||
|
||||
if not enc:
|
||||
enc = sys.getdefaultencoding()
|
||||
|
||||
if not enc or enc == 'ascii':
|
||||
enc = 'utf-8'
|
||||
|
||||
return enc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue