[Python-Dev] Python3 "complexity"
Stephen J. Turnbull
stephen at xemacs.org
Thu Jan 9 11:20:57 CET 2014
Paul Moore writes:
> So I think that if this discussion is to be of any real benefit, a
> specific example is needed. I honestly don't think I've ever
> encountered a case where "Sometimes [I] just want to parse text
> files" and code that uses the default encoding (i.e., looks pretty
> much identical to Python 2) has *failed* to do the job for me.
I don't understand why it fails for Kristján, but I can tell you why
it failed for me: Mac OS X "Snow Leopard" (at least on my box, and
perhaps due to my misconfiguration) doesn't set the locale variables
and for some reason the fallback for locale.getpreferredencoding() is
not UTF-8 (== sys.getfilesystemencoding()) nor some Japanese encoding
(Japanese is my system language), but US-ASCII!
Naturally, putting LANG=ja_JP.UTF-8 in my shell startup fixed that
once and for all, so as I say I don't understand why Kristján has a
More information about the Python-Dev