Closed GoogleCodeExporter closed 9 years ago
Hi. I run gitinspector on many remote (headless systems) without a hitch. This
just sounds to me like a misconfigured terminal? What does the following script
return?:
import locale
import sys
print locale.getpreferredencoding()
print sys.getdefaultencoding()
print sys.stdout.encoding
print sys.stdin.encoding
Gitinspector uses unicode internally; so it needs a reference point in order to
properly encode everything and anything into the right format.
It would be possible to just choose a default encoding when "None" is detected;
I don't know if this is the "correct" solution, though.
Also, if you know the encoding, you could try executing something like the
following on the terminal:
export PYTHONIOENCODING=utf-8; gitinspector.py <opts>
This forces sys.*.encoding into the encoding you specify.
/Adam Waldenberg
Original comment by gitinspe...@ejwa.se
on 9 Nov 2013 at 11:28
Here is the output:
print locale.getpreferredencoding() -> UTF-8
print sys.getdefaultencoding() -> ascii
print sys.stdout.encoding -> None
print sys.stdin.encoding -> None
I tried the the following:
export PYTHONIOENCODING=utf-8
And it worked like a charm!
Jenkins is happy :)
Yeah, I don't know if the terminal is mis-configured, and I agree with you that
it may not be the best assumption to set a default encoding if "None" is
detected. Maybe a potential "fix" is to detect "None" and tell the user to
export the environment variable with the correct encoding.
Thanks for the quick response! Great tool!
Original comment by gray...@gmail.com
on 11 Nov 2013 at 2:27
Great! Good thing that it worked.
I have been looking around a bit in order to somehow improve the behavior. A
common solution seems to be to use the preferred encoding (if one is set). As
you proposed, a warning on stderr is probably in order also; just to let the
user know that something *might* be wrong with the settings of the terminal.
I'll keep this issue open until I have time to do something about it.
/Adam Waldenberg
Original comment by gitinspe...@ejwa.se
on 15 Nov 2013 at 12:37
I'll try to improve this before the next release.
Original comment by gitinspe...@ejwa.se
on 8 Jan 2014 at 2:48
This issue was closed by revision 23bc5fbbea90.
Original comment by gitinspe...@ejwa.se
on 8 Jan 2014 at 5:06
Original issue reported on code.google.com by
gray...@gmail.com
on 9 Nov 2013 at 1:00