Skip to content

Fix store_into with configured scan parser - #439

Open
aaroncostapix wants to merge 1 commit into
p-ranav:masterfrom
aaroncostapix:fix-hex-store-into
Open

aaroncostapix wants to merge 1 commit into
p-ranav:masterfrom
aaroncostapix:fix-hex-store-into

Conversation

@aaroncostapix

Copy link
Copy Markdown

Summary

Fixes #415.

When scan() is combined with scalar numeric store_into(), the destination was parsed again using the default decimal parser, causing valid non-decimal inputs to fail and potentially adding duplicate entries to the parsed-value history.

This change uses the configured scan parser for destination storage at the registered action position. A dedicated storage_action preserves action ordering and exception behavior without introducing duplicate stored values or triggering the resizing and truncation associated with ordinary void actions during repeated (.append()) argument parsing.

Tests

  • Added regression coverage for numeric scan formats (x, X, o, b, u, i, and a) and invalid-input rejection.
  • Verified action ordering and exception behavior.
  • Tested default values, repeated arguments (.append()), and multi-token arguments (nargs).
  • Verified independent parsing when the scan type and destination type differ.

Validation

  • Focused storage suite: 37 test cases passed, 77 assertions.
  • Full suite: 287 test cases passed, 1 skipped, 1,066 assertions passed.
  • git diff --check passed.
  • Static-analysis and sanitizer tools were unavailable in the development environment.

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.

store_into does not properly handle numeric types

1 participant