Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../usr/lib64/python3....
File: _bootlocale.py
"""A minimal subset of the locale module used at interpreter startup
[0] Fix | Delete
(imported by the _io module), in order to reduce startup time.
[1] Fix | Delete
[2] Fix | Delete
Don't import directly from third-party code; use the `locale` module instead!
[3] Fix | Delete
"""
[4] Fix | Delete
[5] Fix | Delete
import sys
[6] Fix | Delete
import _locale
[7] Fix | Delete
[8] Fix | Delete
if sys.platform.startswith("win"):
[9] Fix | Delete
def getpreferredencoding(do_setlocale=True):
[10] Fix | Delete
if sys.flags.utf8_mode:
[11] Fix | Delete
return 'UTF-8'
[12] Fix | Delete
return _locale._getdefaultlocale()[1]
[13] Fix | Delete
else:
[14] Fix | Delete
try:
[15] Fix | Delete
_locale.CODESET
[16] Fix | Delete
except AttributeError:
[17] Fix | Delete
if hasattr(sys, 'getandroidapilevel'):
[18] Fix | Delete
# On Android langinfo.h and CODESET are missing, and UTF-8 is
[19] Fix | Delete
# always used in mbstowcs() and wcstombs().
[20] Fix | Delete
def getpreferredencoding(do_setlocale=True):
[21] Fix | Delete
return 'UTF-8'
[22] Fix | Delete
else:
[23] Fix | Delete
def getpreferredencoding(do_setlocale=True):
[24] Fix | Delete
if sys.flags.utf8_mode:
[25] Fix | Delete
return 'UTF-8'
[26] Fix | Delete
# This path for legacy systems needs the more complex
[27] Fix | Delete
# getdefaultlocale() function, import the full locale module.
[28] Fix | Delete
import locale
[29] Fix | Delete
return locale.getpreferredencoding(do_setlocale)
[30] Fix | Delete
else:
[31] Fix | Delete
def getpreferredencoding(do_setlocale=True):
[32] Fix | Delete
assert not do_setlocale
[33] Fix | Delete
if sys.flags.utf8_mode:
[34] Fix | Delete
return 'UTF-8'
[35] Fix | Delete
result = _locale.nl_langinfo(_locale.CODESET)
[36] Fix | Delete
if not result and sys.platform == 'darwin':
[37] Fix | Delete
# nl_langinfo can return an empty string
[38] Fix | Delete
# when the setting has an invalid value.
[39] Fix | Delete
# Default to UTF-8 in that case because
[40] Fix | Delete
# UTF-8 is the default charset on OSX and
[41] Fix | Delete
# returning nothing will crash the
[42] Fix | Delete
# interpreter.
[43] Fix | Delete
result = 'UTF-8'
[44] Fix | Delete
return result
[45] Fix | Delete
[46] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function