Message96556
| Author |
skrah |
| Recipients |
eric.smith, mark.dickinson, skrah |
| Date |
2009年12月18日.09:38:03 |
| SpamBayes Score |
1.8924584e-11 |
| Marked as misclassified |
No |
| Message-id |
<1261129085.9.0.318928155831.issue7442@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Yes, it's a problem in _localemodule.c. This situation always
occurs when LC_NUMERIC is something like ISO8859-15, LC_CTYPE
is UTF-8 AND the decimal point or separator are in the range
128-255. Then mbstowcs tries to decode the character according
to LC_CTYPE and finds that the character is not valid UTF-8:
static PyObject*mbstowcs
str2uni(const char* s)
{
#ifdef HAVE_BROKEN_MBSTOWCS
size_t needed = strlen(s);
#else
size_t needed = mbstowcs(NULL, s, 0);
#endif
I can't see a portable way to fix this except:
block threads
set temporary LC_CTYPE
call mbstowcs
restore LC_CTYPE
unblock threads
I don't think this issue is important enough to do that. What
I do in cdecimal is raise an error "Invalid separator or
unsupported combination of LC_NUMERIC and LC_CTYPE". |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2009年12月18日 09:38:06 | skrah | set | recipients:
+ skrah, mark.dickinson, eric.smith |
| 2009年12月18日 09:38:05 | skrah | set | messageid: <1261129085.9.0.318928155831.issue7442@psf.upfronthosting.co.za> |
| 2009年12月18日 09:38:04 | skrah | link | issue7442 messages |
| 2009年12月18日 09:38:03 | skrah | create |
|