-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Specifying time in the --output-format flag of seq date causes panic #11732
Copy link
Copy link
Closed
Labels
Milestone
Description
Describe the bug
Specifying time (e.g. %H:%M:%S) in the --output-format flag of seq date causes panic
How to reproduce
❯ seq date --begin-date '2024-01-01T00:00:00' --end-date '2024-01-02T00:00:00' --input-format '%Y-%m-%dT%H:%M:%S' --output-format '%Y-%m-%dT%H:%M:%S'
thread 'main' panicked at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/alloc/src/string.rs:2460:14:
a Display implementation returned an error unexpectedly: Error
stack backtrace:
0: 0x7f8200d59dd1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb67f6e94152691e9
1: 0x7f81fef4a45c - core::fmt::write::h738793984be7f52c
2: 0x7f8200d545fe - std::io::Write::write_fmt::h84056616c47209ca
3: 0x7f8200d59bb4 - std::sys_common::backtrace::print::h7b70e260a2475fa3
4: 0x7f8200d60e13 - std::panicking::default_hook::{{closure}}::h81c979645f368377
5: 0x7f8200d60b5f - std::panicking::default_hook::h157ab9bf73bc8932
6: 0x7f8200d6147a - std::panicking::rust_panic_with_hook::hec9e488e5d9ea17f
7: 0x7f8200d61224 - std::panicking::begin_panic_handler::{{closure}}::h83232311f2354a3d
8: 0x7f8200d5fa06 - std::sys_common::backtrace::__rust_end_short_backtrace::h8a82556d18c9cf5a
9: 0x7f8200d60fa2 - rust_begin_unwind
10: 0x7f81fee00ea3 - core::panicking::panic_fmt::h9fb1cf80aef8bb8a
11: 0x7f81fee0128a - core::result::unwrap_failed::hdeffda1fd287c7d3
12: 0x7f81ff3cb6c7 - nu_command::generators::seq_date::run_seq_dates::h432b21d3a49c5ebe
13: 0x7f81ff3ca4a0 - <nu_command::generators::seq_date::SeqDate as nu_protocol::engine::command::Command>::run::h2b82865656194d8f
14: 0x7f81ff61b750 - nu_engine::eval::eval_call::ha54470bd6f323901
15: 0x7f81ff61d8a0 - nu_engine::eval::eval_expression_with_input::h15be80a52ab8d6f8
16: 0x7f81ff61dca6 - nu_engine::eval::eval_element_with_input::ha50ee84542c9dc3d
17: 0x7f81ff61f2d8 - nu_engine::eval::eval_block::hf49d30108a043a8a
18: 0x7f81ff08a84d - nu_cli::util::eval_source::h3617574100b5b927
19: 0x7f81ff05f8f4 - nu_cli::repl::evaluate_repl::h36aac12101e8f997
20: 0x7f81ff04926f - nu::run::run_repl::h68d1eaf222993f60
21: 0x7f81ff03fc05 - nu::main::hcfbd11e0d9bb3fe3
22: 0x7f81ff04bacb - std::sys_common::backtrace::__rust_begin_short_backtrace::h1d6cb674677a1008
23: 0x7f81ff04c410 - std::rt::lang_start::{{closure}}::h8c7a1bed7c005391
24: 0x7f8200d4a772 - std::rt::lang_start_internal::hc2237e64f4a57445
25: 0x7f81ff040b05 - main
Expected behavior
Output in specified format
╭───┬─────────────────────╮
│ 0 │ 2024-01-01T00:00:00 │
│ 1 │ 2024-01-02T00:00:00 │
╰───┴─────────────────────╯
or error message if time format is not supported.
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.89.0 |
| branch | |
| commit_hash | 2c1560e |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-musl |
| rust_version | rustc 1.73.0 (cc66ad468 2023-10-03) |
| rust_channel | 1.73.0-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.73.0 (9c4383fb5 2023-08-26) |
| build_time | 2024-01-09 20:22:17 +00:00 |
| build_rust_channel | release |
| allocator | mimalloc |
| features | dataframe, default, extra, sqlite, static-link-openssl, trash, which, zip |
| installed_plugins |
Additional context
No response
Reactions are currently unavailable