JuliaTime / TimeZones.jl

IANA time zone database access for the Julia programming language
Other
86 stars 51 forks source link

`Dates.tryparsenext_base10` now parses negative numbers #460

Closed omus closed 1 month ago

omus commented 1 month ago

Seeing these failures on Julia 1.12.0-DEV.570

minutes: Test Failed at /home/runner/work/TimeZones.jl/TimeZones.jl/test/parse.jl:139
  Expression: _parsesub_offset("0:-1") == ParseNextError(minutes_digits_msg, "0:-1", 3, 3)
   Evaluated: ParseNextError("Minutes outside of expected range [0, 59]", "0:-1", 3, 4) == ParseNextError("Expected offset minute digits after colon delimiter", "0:-1", 3, 3)

Stacktrace:
 [1] top-level scope
   @ ~/work/TimeZones.jl/TimeZones.jl/test/parse.jl:102
 [2] macro expansion
   @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Test/src/Test.jl:1700 [inlined]
 [3] macro expansion
   @ ~/work/TimeZones.jl/TimeZones.jl/test/parse.jl:132 [inlined]
 [4] macro expansion
   @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Test/src/Test.jl:1700 [inlined]
 [5] macro expansion
   @ ~/work/TimeZones.jl/TimeZones.jl/test/parse.jl:139 [inlined]
 [6] macro expansion
   @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Test/src/Test.jl:679 [inlined]
seconds: Test Failed at /home/runner/work/TimeZones.jl/TimeZones.jl/test/parse.jl:151
  Expression: _parsesub_offset("0:0:-1") == ParseNextError(seconds_digits_msg, "0:0:-1", 5, 5)
   Evaluated: ParseNextError("Seconds outside of expected range [0, 59]", "0:0:-1", 5, 6) == ParseNextError("Expected offset second digits after colon delimiter", "0:0:-1", 5, 5)

Stacktrace:
 [1] top-level scope
   @ ~/work/TimeZones.jl/TimeZones.jl/test/parse.jl:102
 [2] macro expansion
   @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Test/src/Test.jl:1700 [inlined]
 [3] macro expansion
   @ ~/work/TimeZones.jl/TimeZones.jl/test/parse.jl:143 [inlined]
 [4] macro expansion
   @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Test/src/Test.jl:1700 [inlined]
 [5] macro expansion
   @ ~/work/TimeZones.jl/TimeZones.jl/test/parse.jl:151 [inlined]
 [6] macro expansion
   @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Test/src/Test.jl:679 [inlined]

https://github.com/JuliaTime/TimeZones.jl/actions/runs/9175908884/job/25229961056

The issue was caused from https://github.com/JuliaLang/julia/pull/53981 which updated Dates.tryparsenext_base10 to parse negative values.

After finding a bug with that PR I made an update to the Dates parsing logic in https://github.com/JuliaLang/julia/pull/54535 which also happens to restore tryparsenext_base10 to only parse digits. Possibly, we may want to rename this function to tryparsenext_base10digits.

omus commented 1 month ago

Nightly CI runs on TimeZones.jl are currently broken due to this.

omus commented 1 month ago

Can close as https://github.com/JuliaLang/julia/pull/54535 has been merged