Summary
parse_positive_int's input guard uses str.isdigit(), which is True for non-ASCII digit-like characters that int() can't actually parse.
Details
lib/python/base_cli/history.py:261-267. Verified: '²'.isdigit() (superscript two) is True, but int('²') raises ValueError: invalid literal for int() with base 10: '²'. The whole purpose of this public helper (exported in history.__all__) is to turn bad input into a friendly ValueError(f"Option '{option}' must be a positive integer.").
Impact
This specific class of input instead raises an unhandled internal ValueError with a confusing raw message — the opposite of what the function promises. Any consumer using it for flags like --limit N inherits the same gap.
Suggested fix
Use value.isdecimal() (or a regex ^[0-9]+$) instead of isdigit().
Summary
parse_positive_int's input guard usesstr.isdigit(), which isTruefor non-ASCII digit-like characters thatint()can't actually parse.Details
lib/python/base_cli/history.py:261-267. Verified:'²'.isdigit()(superscript two) isTrue, butint('²')raisesValueError: invalid literal for int() with base 10: '²'. The whole purpose of this public helper (exported inhistory.__all__) is to turn bad input into a friendlyValueError(f"Option '{option}' must be a positive integer.").Impact
This specific class of input instead raises an unhandled internal
ValueErrorwith a confusing raw message — the opposite of what the function promises. Any consumer using it for flags like--limit Ninherits the same gap.Suggested fix
Use
value.isdecimal()(or a regex^[0-9]+$) instead ofisdigit().