Bug Fix: Correct Handling of Asterisk (*) in user_input
Mode
#1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR addresses an issue in the
abserdes
library where an asterisk (*
) in theuser_input
mode is incorrectly interpreted as an integer instead of a string. This caused deserialization to fail with aValueError
when the input contained an asterisk, as described in the issue below:Reproduction of the issue:
Running the script generated the following error:
Root cause:
The bug was traced to the regular expression used in
strcast.py
to determine how strings are interpreted. The current implementation did not handle asterisks or other special characters correctly, leading to incorrect typecasting when it should have treated such inputs as strings.Fix:
strcast.py
to ensure that inputs containing*
,@
, and other non-numeric characters are correctly interpreted as strings.abserdes
to properly handle these special characters when deserializing from XML files inuser_input
mode.Testing:
Note:
Until a more robust solution is implemented, please avoid using numeric-only strings in
user_input
fields that you wantabserdes
to deserialize as strings.