Open Liozou opened 2 years ago
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 https://github.com/JuliaLang/julia/blob/f5d15571b3f1745f7783509e336c4d9f7246cdd9/base/gmp.jl#L284 aka
MPZ.set_str!
does not follow Julia conventions for parsing numbers.Originally posted by @Liozou in https://github.com/JuliaLang/julia/issues/44550#issuecomment-1065457950
Copy-pasted from #44550, discovered by @henriquebecker91