Marc-Andre Lemburg <m...@egenix.com> added the comment: Mark Dickinson wrote: > > Mark Dickinson <dicki...@gmail.com> added the comment: > > About Alexander's solution: might it make more sense to have > PyUnicode_EncodeDecimal raise for inputs like this? I see it as > PyUnicode_EncodeDecimal's job to turn the unicode input into usable ASCII (or > raise an exception); it looks like that's not happening here. > > Adding MAL to the nosy in case he wants to comment on this.
The purpose of the PyUnicode_EncodeDecimal() API is to convert Unicode decimal digits to ASCII digits for interpretation by the other usual functions to convert the ASCII representation to numbers. The proposed patch will not work, since it removes the support for non-ASCII number code points, e.g. Asian number code points. You might want to replace the error message by something more related to floats in the float constructor. Note that UnicodeErrors are subclasses of ValueErrors, so the errors are not unexpected for number constructors. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10557> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com