New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error in unicodedata.numeric(u"\u2187") and 2188 #50632
Comments
I am making a demo program, a class which is a subset of int, which I discover that my conversion routines fail for values > 50000 due to an ----- console dump follows ----- c:\BZR\roman>c:\python26\python.exe
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import unicodedata
>>> unicodedata.name(u"\u2187")
'ROMAN NUMERAL FIFTY THOUSAND'
>>> unicodedata.numeric(u"\u2187")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: not a numeric character
>>> unicodedata.name(u"\u2188")
'ROMAN NUMERAL ONE HUNDRED THOUSAND'
>>> unicodedata.numeric(u"\u2188")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: not a numeric character
>>> unicodedata.name(u"\u2181")
'ROMAN NUMERAL FIVE THOUSAND'
>>> unicodedata.numeric(u"\u2181")
5000.0
>>> |
Python 2.6 and all the following versions use the Unicode database The numeric value is in the database for all the codepoints from U+2185 |
The _PyUnicode_ToNumeric() function was not in line with the unicode |
Wouldn't it make more sense to move this into unicode_db.h? |
Right. Actually unicodetype_db.h is the one included in unicodectype.c, Here is a new patch. The code generated for _PyUnicode_ToNumeric is the |
Wow! Quick response! My outstanding bug on IronPython has been hanging out
|
Notice that this is a duplicate of the longstanding bpo-1571184, which |
Yes, my patch is entirely contained in the one from bpo-1571184. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: