Skip to content

Conversation

@yuankunzhang
Copy link
Contributor

Closes #8508.

@yuankunzhang yuankunzhang marked this pull request as draft August 31, 2025 13:49
@yuankunzhang yuankunzhang force-pushed the who-honor-locale branch 4 times, most recently from bb6f59a to a5e942c Compare August 31, 2025 14:03
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@yuankunzhang yuankunzhang marked this pull request as ready for review August 31, 2025 14:23
Comment on lines +171 to +178
let time_format: Vec<time::format_description::FormatItem> = if lc_time == "C" {
// "%b %e %H:%M"
time::format_description::parse("[month repr:short] [day padding:space] [hour]:[minute]")
.unwrap();
ut.login_time().format(&time_format).unwrap() // LC_ALL=C
.unwrap()
} else {
// "%Y-%m-%d %H:%M"
time::format_description::parse("[year]-[month]-[day] [hour]:[minute]").unwrap()
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably outside the scope of this PR: GNU who also uses the C format for invalid/non-installed locales:

$ LC_ALL=invalid who -b
         system boot  Sep  1 13:24
$ LC_ALL=fr_FR.UTF-8 who -b
         system boot  Sep  1 13:24

@github-actions
Copy link

github-actions bot commented Sep 1, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker merged commit 53c4bae into uutils:main Sep 1, 2025
93 checks passed
@cakebaker
Copy link
Contributor

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"who" time format does not respect locale

2 participants