[anaconda][master] Make sure we always use "utf-8" as the default encoding (#1169019)

Adam Williamson awilliam at redhat.com
Wed Feb 25 17:21:07 UTC 2015


On Wed, 2015-02-18 at 15:10 -0800, Brian C. Lane wrote:
> 
> I'm not sure about this. I find various references saying not to do 
> this, that it may break other things. I also came across this:
> 
> https://fedoraproject.org/wiki/Features/PythonEncodingUsesSystemLocale

"     Percentage of completion: withdrawn by owner

The upstream python community has requested that I not make this 
change, so I'm withdrawing this feature proposal."

> But it doesn't look like the change was ever made since this happens 
> on f21:
> 
> python -c 'print u"\u03b1\u03b2\u03b3"' > foo.txt
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   UnicodeEncodeError: 'ascii' codec can't encode characters in 
> position 0-2: ordinal not in range(128)
> 
> My impression has always been that reload is for interactive use, 
> and even then generally doesn't work like you expect it to.

The only other approach I can see unfortunately is the sucky one of 
one-at-a-time 'we file a UnicodeEncodeDecodeError, you track down the 
offending string and .encode() it' :/

I suppose we could at least try some sort of brute-force testing 
approach using anaconda's CI and/or QA's OpenQA setup - just have them 
run an install (ideally going through custom part) in every single 
language, or a reasonable sampling of ones that use non-Latin 
alphabets? that ought to hit the most obvious cases at least. I'm not 
sure whether we'd have to re-implement the test for every language in 
OpenQA, though, given its screenshot based approach :/
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net



More information about the anaconda-patches mailing list