diff options
| author | Volodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com> | 2026-09-07 14:24:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-07 08:24:16 -0400 |
| commit | a31f9affde680d1b93b1283955764d247ee3bb4d (patch) | |
| tree | b6988e89599fabb8b2742b2f18cd572cdf88649c /runtime/lua/vim/async/_runtime.lua | |
| parent | 1c8d5581d93cb22076273d114d78c44f8ce9720c (diff) | |
| download | rneovim-a31f9affde680d1b93b1283955764d247ee3bb4d.tar.gz rneovim-a31f9affde680d1b93b1283955764d247ee3bb4d.tar.bz2 rneovim-a31f9affde680d1b93b1283955764d247ee3bb4d.zip | |
fix(msgpack): strptime() fails east of UTC+12 #41743
Problem:
msgpack#strptime() finds a timestamp by bisecting strftime() output, and
brackets the search with the extreme UTC offsets. The lower bound
subtracts 12 hours, but -12:00 is the westernmost offset, which produces
the *largest* timestamp for a given local time. The easternmost offset
is +14:00, so in any zone east of UTC+12 the search can start above the
target and the function throws:
internal-start-string:Internal error: start > string
With TZ=GMT-14, four of the five timestamps in msgpack_spec.lua fail,
as do three tests in shada_spec.lua, which reaches the same function
through shada#strings_to_sd().
Solution:
Subtract 14 hours instead. The upper bound is already generous enough at
+14, and widening a bisection bracket downwards cannot change the result
in zones that worked before.
The test disables the python3 provider, because msgpack#strptime() only
uses the Vimscript implementation changed here when no provider answers,
and otherwise hands the work to datetime.strptime().
AI-assisted
Diffstat (limited to 'runtime/lua/vim/async/_runtime.lua')
0 files changed, 0 insertions, 0 deletions