Message90302
| Author |
ned.deily |
| Recipients |
Phil, mark.dickinson, ned.deily, ronaldoussoren |
| Date |
2009年07月09日.03:55:40 |
| SpamBayes Score |
6.1713814e-07 |
| Marked as misclassified |
No |
| Message-id |
<1247111742.29.0.763946868613.issue6393@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Note, you can produce the same error on OS X or linux by setting
PYTHONIOENCODING="", which effectively overrides the value returned
nl_langinfo(CODESET). In pythonrun.c, create_stdio passes
PYTHONENCODING, if set, on as the "encoding" value to TextIOWrapper. If
no encoding was specified, TextIOWrapper uses the value returned by
locale.getpreferrencoding(). It then calls PyCodec_IncrementalDecoder
and the unknown (or empty) encoding is finally detected.
That raises the question of how far python should go in protecting the
user. One *could* add a check in pythonrun.c to substitute some
suitable default (UTF-8) if nl_langinfo(CODESET) returns an empty value.
Or perhaps just abort there with a more meaningful error message. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2009年07月09日 03:55:42 | ned.deily | set | recipients:
+ ned.deily, ronaldoussoren, mark.dickinson, Phil |
| 2009年07月09日 03:55:42 | ned.deily | set | messageid: <1247111742.29.0.763946868613.issue6393@psf.upfronthosting.co.za> |
| 2009年07月09日 03:55:40 | ned.deily | link | issue6393 messages |
| 2009年07月09日 03:55:40 | ned.deily | create |
|