-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BigInt parsing allows whitespace #44570
Comments
I'm not sure how (easy it is) to fix this. I like better to just drop BigInt support... move it too a package (making Julia smaller), yes a breaking change, or could still be loaded by default, conditional on an ENV var. Not having it (be default or not) would get rid of a number of bugs like this one, and e.g. #52862 |
Note that Parsers.jl correctly errors in this case (though admittedly the error message mentioning "SUCCESS" is probably confusing along with the absence of a helpful error message): julia> Parsers.parse(BigInt, "100 10")
ERROR: Parsers.Error (SUCCESS: OK ):
initial value parsing succeeded
attempted to parse BigInt from: "100 10"
Stacktrace:
[1] parse
@ ~/.julia/dev/Parsers/src/Parsers.jl:366 [inlined]
[2] parse(::Type{BigInt}, buf::String)
@ Parsers ~/.julia/dev/Parsers/src/Parsers.jl:362
[3] top-level scope
@ REPL[7]:1
|
The second case is the oddity here, and it seems to originate from
julia/base/gmp.jl
Line 284 in f5d1557
aka
MPZ.set_str!
does not follow Julia conventions for parsing numbers.Originally posted by @Liozou in #44550 (comment)
Copy-pasted from #44550, discovered by @henriquebecker91
The text was updated successfully, but these errors were encountered: