The Wayback Machine - https://web.archive.org/web/20210801054530/https://github.com/Peltoche/lsd/issues/529
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic: No such local time #529

Open
The-Compiler opened this issue Jun 14, 2021 · 1 comment
Open

Panic: No such local time #529

The-Compiler opened this issue Jun 14, 2021 · 1 comment

Comments

@The-Compiler
Copy link

@The-Compiler The-Compiler commented Jun 14, 2021

  • os: Archlinux
  • lsd --version: lsd 0.20.1
  • echo $TERM: xterm-kitty
  • echo $LS_COLORS: quite long and hopefully not relevant 馃檪

Expected behavior

I have an Onyx Boox ereader which I'm mounting via jmtpfs - looking at how old that project is I probably should switch to something else, but alas...

For some reason, this results in files apparently created in the year 4437052:

$ /bin/ls --full-time
total 0
drwxr-xr-x 26 florian florian 0 4437052-10-03 00:35:12.000000000 +0200 'Internal storage'

I'd expect lsd to show the file in the same way, or perhaps just show an "invalid time" or something.

Actual behavior

lsd crashes with thread 'main' panicked at 'No such local time', /build/.cargo/registry/src/github.com-1ecc6299db9ec823/chrono-0.4.15/src/offset/mod.rs:173:34.

Stack:

   0: std::panicking::begin_panic
   1: <chrono::datetime::DateTime<chrono::offset::local::Local> as core::convert::From<std::time::SystemTime>>::from
   2: lsd::meta::Meta::from_path
   3: lsd::meta::Meta::recurse_into
   4: lsd::core::Core::run
   5: lsd::main
@zwpaper
Copy link
Collaborator

@zwpaper zwpaper commented Jun 14, 2021

it should be caused by the invalid time format here:

fn from(meta: &'a Metadata) -> Self {

we could check the time before converting it into the DateTime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment