mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-22 04:48:57 +00:00
#398: Fix UnicodeDecodeError in logs
This commit is contained in:
parent
cc9af78787
commit
81f6a25abc
@ -28,7 +28,7 @@ def exception(title, exc_info):
|
|||||||
|
|
||||||
|
|
||||||
def rule_failed(rule, exc_info):
|
def rule_failed(rule, exc_info):
|
||||||
exception('Rule {}'.format(rule.name), exc_info)
|
exception(u'Rule {}'.format(rule.name), exc_info)
|
||||||
|
|
||||||
|
|
||||||
def failed(msg):
|
def failed(msg):
|
||||||
@ -41,7 +41,7 @@ def failed(msg):
|
|||||||
def show_corrected_command(corrected_command):
|
def show_corrected_command(corrected_command):
|
||||||
sys.stderr.write(u'{bold}{script}{reset}{side_effect}\n'.format(
|
sys.stderr.write(u'{bold}{script}{reset}{side_effect}\n'.format(
|
||||||
script=corrected_command.script,
|
script=corrected_command.script,
|
||||||
side_effect=' (+side effect)' if corrected_command.side_effect else '',
|
side_effect=u' (+side effect)' if corrected_command.side_effect else u'',
|
||||||
bold=color(colorama.Style.BRIGHT),
|
bold=color(colorama.Style.BRIGHT),
|
||||||
reset=color(colorama.Style.RESET_ALL)))
|
reset=color(colorama.Style.RESET_ALL)))
|
||||||
|
|
||||||
@ -49,8 +49,8 @@ def show_corrected_command(corrected_command):
|
|||||||
def confirm_text(corrected_command):
|
def confirm_text(corrected_command):
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
(u'{clear}{bold}{script}{reset}{side_effect} '
|
(u'{clear}{bold}{script}{reset}{side_effect} '
|
||||||
'[{green}enter{reset}/{blue}↑{reset}/{blue}↓{reset}'
|
u'[{green}enter{reset}/{blue}↑{reset}/{blue}↓{reset}'
|
||||||
'/{red}ctrl+c{reset}]').format(
|
u'/{red}ctrl+c{reset}]').format(
|
||||||
script=corrected_command.script,
|
script=corrected_command.script,
|
||||||
side_effect=' (+side effect)' if corrected_command.side_effect else '',
|
side_effect=' (+side effect)' if corrected_command.side_effect else '',
|
||||||
clear='\033[1K\r',
|
clear='\033[1K\r',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user