|
|
@ -264,8 +264,7 @@ class Display(metaclass=Singleton):
|
|
|
|
msg2 = msg2 + u'\n'
|
|
|
|
msg2 = msg2 + u'\n'
|
|
|
|
|
|
|
|
|
|
|
|
msg2 = to_bytes(msg2, encoding=self._output_encoding(stderr=stderr))
|
|
|
|
msg2 = to_bytes(msg2, encoding=self._output_encoding(stderr=stderr))
|
|
|
|
if sys.version_info >= (3,):
|
|
|
|
# Convert back to text string
|
|
|
|
# Convert back to text string on python3
|
|
|
|
|
|
|
|
# We first convert to a byte string so that we get rid of
|
|
|
|
# We first convert to a byte string so that we get rid of
|
|
|
|
# characters that are invalid in the user's locale
|
|
|
|
# characters that are invalid in the user's locale
|
|
|
|
msg2 = to_text(msg2, self._output_encoding(stderr=stderr), errors='replace')
|
|
|
|
msg2 = to_text(msg2, self._output_encoding(stderr=stderr), errors='replace')
|
|
|
@ -292,8 +291,7 @@ class Display(metaclass=Singleton):
|
|
|
|
# color and characters that are invalid in the user's locale
|
|
|
|
# color and characters that are invalid in the user's locale
|
|
|
|
msg2 = to_bytes(nocolor.lstrip(u'\n'))
|
|
|
|
msg2 = to_bytes(nocolor.lstrip(u'\n'))
|
|
|
|
|
|
|
|
|
|
|
|
if sys.version_info >= (3,):
|
|
|
|
# Convert back to text string
|
|
|
|
# Convert back to text string on python3
|
|
|
|
|
|
|
|
msg2 = to_text(msg2, self._output_encoding(stderr=stderr))
|
|
|
|
msg2 = to_text(msg2, self._output_encoding(stderr=stderr))
|
|
|
|
|
|
|
|
|
|
|
|
lvl = logging.INFO
|
|
|
|
lvl = logging.INFO
|
|
|
@ -463,8 +461,7 @@ class Display(metaclass=Singleton):
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def prompt(msg, private=False):
|
|
|
|
def prompt(msg, private=False):
|
|
|
|
prompt_string = to_bytes(msg, encoding=Display._output_encoding())
|
|
|
|
prompt_string = to_bytes(msg, encoding=Display._output_encoding())
|
|
|
|
if sys.version_info >= (3,):
|
|
|
|
# Convert back into text. We do this double conversion
|
|
|
|
# Convert back into text on python3. We do this double conversion
|
|
|
|
|
|
|
|
# to get rid of characters that are illegal in the user's locale
|
|
|
|
# to get rid of characters that are illegal in the user's locale
|
|
|
|
prompt_string = to_text(prompt_string)
|
|
|
|
prompt_string = to_text(prompt_string)
|
|
|
|
|
|
|
|
|
|
|
|