You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I stumbled upon this issue while using duviz on my disk with an accentuated letter ("é").
The error was:
File "/usr/local/bin/duviz.py", line 72, in from_path_size_pairs
for path, size in pairs:
File "/usr/local/bin/duviz.py", line 130, in pairs
progress_report(path)
File "/usr/local/bin/duviz.py", line 453, in progress
write(info.ljust(terminal_width)[:terminal_width] + '\r')
UnicodeEncodeError: 'ascii' codec can't encode character '\u2014' in position 138: ordinal not in range(128)
and according to this article it can be resolved by adding (the one which worked for me):
os.environ["PYTHONIOENCODING"] = "utf-8"
at the beginning of main()
Nicola
The text was updated successfully, but these errors were encountered:
canepan
added a commit
to canepan/duviz
that referenced
this issue
Apr 30, 2021
I don't completely understand: the exception talks about character '\u2014' which is "EM DASH", not accented "é"
I'm also not sure about setting os.environ["PYTHONIOENCODING"] from within the script. It doesn't seem good style to blindly set an env variable in a script, I think this should be set properly in the shell. Moreover, if I understand the docs https://docs.python.org/3/using/cmdline.html#envvar-PYTHONIOENCODING correctly, setting it inside the script (so not "before running the interpreter") will not be effective in the first place.
Hi, I stumbled upon this issue while using
duviz
on my disk with an accentuated letter ("é").The error was:
and according to this article it can be resolved by adding (the one which worked for me):
at the beginning of
main()
Nicola
The text was updated successfully, but these errors were encountered: