Repository navigation
obfuscate's negative-offset refusal quotes the offset through _message_text (closes #2874) - #2908
Conversation
…e_text (closes btclib-org#2874) obfuscation.obfuscate built "negative offset: {offset}" with str(), so an offset of -10**4400 raised the builtin ValueError of str()'s digit limit instead of BTClibValueError. The message now quotes the offset through utils._message_text, as the non-integer refusal above it has done since btclib-org#2865. tests/huge_int_message_test.py gains an "obfuscation offset" case at -_HUGE. Signed-off-by: dodoshell <326978213+dodoshell@users.noreply.github.com>
|
Claimed: a /btclib-pr session of @pmazzocchi is reviewing this pull request locally before deciding on its approval. |
pmazzocchi
left a comment
There was a problem hiding this comment.
Approve fe5cf2a, following @pmazzocchi's decision to approve the pull requests a local review clears.
A fresh local reviewer, run in Claude Code (Codex is not installed on this machine), answered CLEARED fe5cf2aa69b9 on the merge with main 7f305e2; no rebase since. It ran obfuscate's refusal from the parent and the head on -(10**4300) and -10**5000: the parent raises the builtin ValueError of the 4300-digit limit, the head raises BTClibValueError with a negative int of … bits, and -1, the 4300-digit boundary and an IntEnum read the same on both. The review bot does not run on a fork's pull request, so there is no ACK; every check passed or was skipped, including the whole suite (run 41503667610), and no thread is open. Not checked: the inputs through an installed btclib, since the local install was refused, and Python 3.11.
|
Thank you, @dodoshell: this landed as 95dbf35, and ISS #2874 is closed. Your change makes |
|
Released: the /btclib-pr session is done with this pull request. |
What this changes
obfuscation.obfuscatequoted a negative offset withstr(), so an offset of-10**4400raised the builtinValueErrorofstr()'s digit limit instead ofBTClibValueError. The refusal now quotes the offset throughutils._message_text, as the non-integer refusal above it has done since #2865.Closes #2874
How it was verified
tests/huge_int_message_test.pygains anobfuscation offsetcase at-_HUGE. It fails onmainwith the builtinValueErrorand passes with the fix.Checks
uv run pre-commit run --all-filesis clean (ruff, mypy strict,markdownlint, the copyright notice,
uv.lock)uv run pytestpassesanswer a review of it without the model
The pre-commit box is unticked because the hook set can't run in full on my Windows machine: the hooks that check Python files pass, and the markdown and line-ending hooks are left to CI.
Summary by CodeRabbit