Skip to content

Handle Unicode decimal input consistently - #169

Merged
codeforester merged 1 commit into
mainfrom
bug/145-20260807-positive-int-unicode
Aug 7, 2026
Merged

Handle Unicode decimal input consistently#169
codeforester merged 1 commit into
mainfrom
bug/145-20260807-positive-int-unicode

Conversation

@codeforester

Copy link
Copy Markdown
Contributor

Summary

  • use str.isdecimal() before integer conversion
  • preserve the friendly positive-integer error for superscript and other digit-like input
  • cover both accepted decimal digits and rejected superscript input

Closes #145.

Validation

  • ruff format --check lib/python/base_cli/history.py tests/test_history.py
  • ruff check lib/python/base_cli/history.py tests/test_history.py
  • pytest -q tests/test_history.py
  • mypy --strict lib/python/base_cli
  • git diff --check

@codeforester
codeforester merged commit b4af29a into main Aug 7, 2026
81 checks passed
@codeforester
codeforester deleted the bug/145-20260807-positive-int-unicode branch August 7, 2026 20:36
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 this pull request may close these issues.

parse_positive_int accepts Unicode digit characters that then crash int() with a raw, unfriendly exception

1 participant