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

charref() maybe throw OverflowError: Python int too large to convert to C int #398

Open
liujuncn opened this issue Mar 8, 2023 · 1 comment

Comments

@liujuncn
Copy link

liujuncn commented Mar 8, 2023

in charref():
if name[0] in ["x", "X"]: c = int(name[1:], 16) else: c = int(name)
if name like "xabcdeabcdeabcdeabcde" will cause chr(c) throw OverflowError.

@liujuncn
Copy link
Author

liujuncn commented Mar 8, 2023

I simply fixed it with:
c = int(name[1:5], 16)

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

No branches or pull requests

1 participant