Message235202
| Author |
skip.montanaro |
| Recipients |
serhiy.storchaka, skip.montanaro |
| Date |
2015年02月01日.20:15:41 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CANc-5Uwwr4hpdVsZZw2B+3b9nFZsAb73b9Ub6AG96k3hiRUYNg@mail.gmail.com> |
| In-reply-to |
<1422820290.9.0.329189755834.issue23374@psf.upfronthosting.co.za> |
| Content |
Without setting any environment variables:
>>> import sys
>>> sys.getfilesystemencoding()
'utf-8'
>>> import locale
>>> locale.getpreferredencoding(False)
'US-ASCII'
>>> import os
>>> os.popen('cat', 'w').encoding
'US-ASCII'
If I set PYTHONIOENCODING=UTF-8:
>>> import sys, locale, os
>>> sys.getfilesystemencoding()
'utf-8'
>>> locale.getpreferredencoding(False)
'US-ASCII'
>>> os.popen('cat', 'w').encoding
'US-ASCII'
If I set LANG=en_US.utf8:
>>> import sys, locale, os
>>> sys.getfilesystemencoding()
'utf-8'
>>> locale.getpreferredencoding(False)
'US-ASCII'
>>> os.popen('cat', 'w').encoding
'US-ASCII'
It appears neither of these environment variables does much in my environment.
I should point out that I just updated to Mac OS X 10.10.2 a couple
days ago. I have no idea if this problem existed before that upgrade.
Realizing that perhaps something had changed in the underlying
operating system support, I rebuilt Python 2.6 through 3.5 from
scratch. Same result. |
|