GNOME Bugzilla – Bug 324323
"import gtk" changes sys.getdefaultencoding()
Last modified: 2005-12-17 10:51:16 UTC
Thos bug has been opened here: http://bugzilla.ubuntu.com/show_bug.cgi?id=21024 ">>> import sys >>> print sys.getdefaultencoding() 'ascii' >>> import gtk >>> print sys.getdefaultencoding() 'utf-8' This is bad. It is generally a bad idea for a library to change global state that may break other libraries; it's worse that it does this as a side-effect of merely being imported. sys.setdefaultencoding is also generally considered a misfeature by the Python developers, and changing the default encoding from 'ascii' (except perhaps to 'undefined') is asking for potential bugs to be hidden, rather than raising exceptions when you'd expect. There's a reason sys.setdefaultencoding is not accessible by default."
*** This bug has been marked as a duplicate of 132040 ***