Message105005
| Author |
vstinner |
| Recipients |
Arfrever, lemburg, loewis, pitrou, vstinner |
| Date |
2010年05月05日.08:57:59 |
| SpamBayes Score |
4.8933175e-06 |
| Marked as misclassified |
No |
| Message-id |
<1273049882.6.0.568296637609.issue8610@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> manpage for nl_langinfo() doesn't mention any errors that could
> be raised by it
It's more about get_codeset(). This function can fail for different reasons:
- nl_langinfo() result is an empty string: "If item is not valid, a pointer to an empty string is returned." say the manpage
- _PyCodec_Lookup() failed: unable to import the encoding codec module, there is no such codec, codec machinery is broken, etc.
- the codec has no "name "attribute
- strdup() failure (no more memory)
Do you think that you should fallback to ASCII if nl_langinfo() result is an empty string, and UTF-8 otherwise? get_codeset() failure is very unlikely, and I think that fallback to UTF-8 is just fine. A warning is printed to stderr, the user should try to understand why get_codeset() failed.
You can at least reproduce the _PyCodec_Lookup() error with #8611.
My problem is also that the file system encoding is required (encoding != None) by os.environ mapping with my os.environb patch. (#8603) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年05月05日 08:58:02 | vstinner | set | recipients:
+ vstinner, lemburg, loewis, pitrou, Arfrever |
| 2010年05月05日 08:58:02 | vstinner | set | messageid: <1273049882.6.0.568296637609.issue8610@psf.upfronthosting.co.za> |
| 2010年05月05日 08:58:01 | vstinner | link | issue8610 messages |
| 2010年05月05日 08:57:59 | vstinner | create |
|