@@ -458,17 +458,6 @@ NumPyOS_ascii_strtod(const char *s, char** endptr)
458
458
struct lconv * locale_data = localeconv ();
459
459
const char * decimal_point = locale_data -> decimal_point ;
460
460
size_t decimal_point_len = strlen (decimal_point );
461
- /*
462
- * It is unclear why this function needs locale information.
463
- * The goal is to do locale-independent parsing. This function
464
- * contains code to stop the parsing early if an unusual decimal
465
- * point is encountered and then pass the string so far to
466
- * NumPyOS_ascii_strtod_plain, which will also stop if an unusual
467
- * decimal point is encountered. The only case I can think of
468
- * where this would matter is if the decimal separator were
469
- * something that could occur in the middle of a valid number,
470
- * in which case this function does the wrong thing.
471
- */
472
461
473
462
char buffer [FLOAT_FORMATBUFLEN + 1 ];
474
463
const char * p ;
@@ -525,10 +514,12 @@ NumPyOS_ascii_strtod(const char *s, char** endptr)
525
514
/*
526
515
* ## 2
527
516
*
528
- * At least Python versions <= 2.6.1
517
+ * At least Python versions <= 2.6.8
529
518
*
530
519
* Fails to do best-efforts parsing of strings of the form "1<DP>234"
531
520
* where <DP> is the decimal point under the foreign locale.
521
+ * This is because PyOS_ascii_strtod is buggy, and will completely
522
+ * refuse to parse the string, rather than parsing the first part "1".
532
523
*/
533
524
if (decimal_point [0 ] != '.' || decimal_point [1 ] != 0 ) {
534
525
p = s ;
0 commit comments