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

Adam Williamson awilliam at redhat.com
Thu Dec 4 01:24:23 UTC 2014

On Wed, 2014-12-03 at 18:55 -0500, Colin Walters wrote:
> On Mon, Dec 1, 2014, at 11:32 PM, Adam Williamson wrote:
> > +# force python's default encoding to be utf-8, not ascii. all the ways to
> > +# do this are bad, but this at least works for live and non-live.
> > +# see RHBZ #1169019, RHBZ #539904
> > +reload(sys)
> > +sys.setdefaultencoding('utf-8')
> See also:
> https://mail.python.org/pipermail/python-dev/2008-February/077134.html
> I think pygobject still carries that, though I'm only seeing it in the "pygtkcompat" layer.

So this was actually mentioned back when anaconda's *initial* hack to
set utf-8 was added, the one that still works for non-live but has never
worked for live. See
https://bugzilla.redhat.com/show_bug.cgi?id=539904#c21 : "Why it does
not happen during graphical install:
because we do 'import gtk' which has a nasty side-effect of setting the
default encoding to 'utf8', see:

These days, pygtk2 still has the hack, and it works, but anaconda
doesn't use it any more. I agree with your assessment that pygobject3
has it in pygtkcompat:

>>> import sys
>>> print(sys.getdefaultencoding())
>>> import pygtkcompat
>>> pygtkcompat.enable_gtk()
>>> print(sys.getdefaultencoding())

but I don't *think* anaconda uses this stuff. So, it seems reasonable to
guess that lives actually inherited the pygtk2 hack up until the switch
to GTK+ 3, which I believe was newUI (i.e. 18), right?
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net

More information about the anaconda-patches mailing list