Skip to content

Numbat panics on the date time format string %: #801

@rben01

Description

@rben01

This seems to be caused by jiff. Not sure if simply updating jiff to the latest version, v0.2.18, would fix this, as the file mentioned in the panic message doesn't even exist in the jiff GitHub repo anymore.

To reproduce:

  █▄░█ █░█ █▀▄▀█ █▄▄ ▄▀█ ▀█▀    Numbat 1.18.0
  █░▀█ █▄█ █░▀░█ █▄█ █▀█ ░█░    https://numbat.dev/

>>> format_datetime("%:", now())

thread 'main' (41394987) panicked at /Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/index.crates.io-1949cf8c6b5b557f/jiff-0.2.14/src/fmt/strtime/format.rs:170:9:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The format string is invalid, but obviously this should not cause numbat to panic. This seems unique to this particular format string; other invalid format strings don't lead to a panic, suggesting that this is a formatting logic bug somewhere in jiff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions