Commit b035507b authored by Valentin Samir's avatar Valentin Samir

[affich_tools] debug sur des UnicodeDecodeError

parent 248d1998
......@@ -278,7 +278,11 @@ def prompt(prompt, defaut='', couleur='gras'):
if defaut :
sys.stdout.write((" [%s]" % defaut).encode(encoding))
sys.stdout.write(" ".encode(encoding))
v = sys.stdin.readline().decode(encoding).strip()
v = sys.stdin.readline()
try:
v = v.decode(encoding).strip()
except UnicodeDecodeError as error:
raise UnicodeDecodeError("%s: %r" % (error, v))
if not v: v = defaut
return v
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment