This commit is contained in:
Miroslav Stampar
2019-11-30 23:10:20 +01:00
parent f947c5f76e
commit 20d875a8ce
4 changed files with 10 additions and 4 deletions

View File

@@ -231,6 +231,11 @@ def getBytes(value, encoding=UNICODE_ENCODING, errors="strict", unsafe=True):
retVal = value
try:
codecs.lookup(encoding)
except LookupError:
encoding = UNICODE_ENCODING
if isinstance(value, six.text_type):
if INVALID_UNICODE_PRIVATE_AREA:
if unsafe:
@@ -391,4 +396,4 @@ def getConsoleLength(value):
else:
retVal = len(value)
return retVal
return retVal