Skip to content

ls: Do not crash on unknown format specifier (e.g. +%Y %0) #7802

Closed
@drinkcat

Description

@drinkcat

Found this while doing some optimization of ls.

$ ls -l --time-style="+%Y %0"
total 61600
-rw-r--r-- 1 drinkcat drinkcat 50337176 2025 %0 all
...
$ cargo run ls -l --time-style="+%Y %0"
thread 'main' panicked at /home/drinkcat/nobackup/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:2783:14:
a Display implementation returned an error unexpectedly: Error
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
total 61600

Looks like this is known in #7687 (@tertsdiepraam, @Qelxiros).

So IIUC we just need to wait for the next chrono release and switch to new_lenient: chronotope/chrono#1693 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions