[f21-branch][master][PATCH 2/2] sgallagh: force defaultencoding to utf-8 on live (#1169019)

Adam Williamson awilliam at redhat.com
Wed Dec 3 23:38:18 UTC 2014

On Mon, 2014-12-01 at 20:32 -0800, Adam Williamson wrote:
> This has been done via pyanaconda/sitecustomize.py for non-live
> since Fedora 13, per #539904, commit 42a0227. However, that hack
> never worked for the live environment. This hack is about
> equally hacky, but works for live as well. This avoids crashes
> when we get unicode objects from pyparted and try to encode
> them. Written by Stephen Gallagher, he and I have tested that
> it resolves the crashes seen in F21 RC1 without breaking
> translations.

So we reverted pyparted to avoid the need for this in F21. However, we
do still need to do something about it on master, assuming we're not
going to downgrade F22 to pyparted 3.9.

I guess we can either:

1) take sgallagh's hack for getting python's defaultencoding set to
utf-8 for anaconda on live (this patch)

2) same idea, different hack. for e.g., iirc, vpodzime preferred it
going in the top-level anaconda script, right after "if __name__ ==
"__main__":". maybe someone else has another approach to the same end.

3) try for a more 'correct' fix to the problem than relying on python's
fallback defaultencoding setting - either explicitly format the unicode
objects with the appropriate encoding whenever we use them, or find some
other way to make python use utf-8 when we don't explicitly set it, I
guess? the latter is what vpodzime's original fix attempt did, by
setting LC_ALL at the environment level, but that had serious

4) switch to python3! that ought to fix this, and I'm sure it won't
cause any other issues, should be an easyfix. ;)

5) something else?

F22 testing is currently blocked by
https://bugzilla.redhat.com/show_bug.cgi?id=1167036 until a new anaconda
build is done, but it stands to reason that until something is done
about this, F22 live installs in languages that have any non-ASCII
characters in translations for words that are found in the stuff
pyparted is sending as unicode objects will crash (I think that's the
accurate statement of the problem - the monkey-level understanding of it
is 'when I do an install in Russian it always crashes on the translation
of MiB or KiB or GiB, which has Russian characters in it').
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net

More information about the anaconda-patches mailing list