Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Setting The Default Encoding In Python.
Especially inside of a python module intended to be imported by others.
There's a very good reason why the defaultencoding is removed from the Python namespace and you have to resort to hackery to access it.
http://ziade.org/2008/01/08/syssetdefaultencoding-is-evil/
As the other poster said, just move to Python 3 and stop worrying about this mess.
There are no comments on this comment yet.
Especially inside of a python module intended to be imported by others.
There's a very good reason why the defaultencoding is removed from the Python namespace and you have to resort to hackery to access it.
You should be handling encode/decode explicitly; not resorting to changing the default system encoding. You will break other consumers.As the other poster said, just move to Python 3 and stop worrying about this mess.