Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Benjamin Graillot
scripts
Commits
b035507b
Commit
b035507b
authored
Nov 20, 2013
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[affich_tools] debug sur des UnicodeDecodeError
parent
248d1998
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
gestion/affich_tools.py
gestion/affich_tools.py
+5
-1
No files found.
gestion/affich_tools.py
View file @
b035507b
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment