Skip to content
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

Test fails with Python 3.9 #118

Closed
swt2c opened this issue Nov 3, 2020 · 1 comment · Fixed by #119
Closed

Test fails with Python 3.9 #118

swt2c opened this issue Nov 3, 2020 · 1 comment · Fixed by #119

Comments

@swt2c
Copy link
Contributor

swt2c commented Nov 3, 2020

There is a unit test failure with Python 3.9 (as observed on Fedora 33 and on Debian Unstable).

__ test_numeric_chars_contains_all_valid_unicode_numeric_and_digit_characters __

    def test_numeric_chars_contains_all_valid_unicode_numeric_and_digit_characters():
        set_numeric_hex = set(numeric_hex)
        set_numeric_chars = set(numeric_chars)
        set_digit_chars = set(digit_chars)
        set_decimal_chars = set(decimal_chars)
        for i in range(0X110000):
            try:
                a = chr(i)
            except ValueError:
                break
            if a in "0123456789":
                continue
            if unicodedata.numeric(a, None) is not None:
>               assert i in set_numeric_hex
E               assert 69573 in {178, 179, 185, 188, 189, 190, ...}

tests/test_unicode_numbers.py:49: AssertionError

Doing a little bit of debugging, indeed on Python < 3.9, unicodedata.numeric(chr(69573)) throws a ValueError, while on Python 3.9, it returns 1.0. Thus, it seems that new numeric hex value(s) have been added in Python 3.9? Is the solution to add 0x10FC5 to unicode_numeric_hex.py, but will that break things on older Pythons?

@SethMMorton
Copy link
Owner

Yeah, an update like this is expected with each Python minor release since new valid unicode characters get added - #104 was the merge request for when Python 3.8 was released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants