Skip to content

Set the locale for test1981 explicit#21749

Closed
icing wants to merge 2 commits into
curl:masterfrom
icing:test1981-locale-explicit
Closed

Set the locale for test1981 explicit#21749
icing wants to merge 2 commits into
curl:masterfrom
icing:test1981-locale-explicit

Conversation

@icing
Copy link
Copy Markdown
Contributor

@icing icing commented May 26, 2026

Otherwise we may get a different month name in the output.

@github-actions github-actions Bot added the tests label May 26, 2026
@icing icing changed the title Set the local for test1981 explicit Set the locale for test1981 explicit May 26, 2026
@icing icing requested a review from bagder May 26, 2026 08:43
@vszakats
Copy link
Copy Markdown
Member

vszakats commented May 26, 2026

Is there a good env that reproduces this? (tried a few without success)
I'm thinking we could add this to CI to test this combo.

edit: was enough to write this msg, now I got one that triggers locally: LC_ALL= LANG=fr_FR.UTF-8
Making a PR with this.

@icing
Copy link
Copy Markdown
Contributor Author

icing commented May 26, 2026

I got failure after my recent (unvoluntary) upgrade to macOS Tahoe. Supposedly using the sytem German local where the month name is "Aug." - for whatever reason someone did this.

Comment thread tests/data/test1981 Outdated
</features>
<setenv>
CURL_TIME=1754037103
LC_ALL=en
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
LC_ALL=en
LC_TIME=C

Proposing this alternate to limit the fix on datetime names
and to be language-agnostic by using the value C. Works
well as tested in #21753.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed. (I resisted debating how testing for "Aug" as month is "language-agnostic" but it is just too hot. 😌

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I meant some systems may not specifically have 'en' installed, but 'C' should be always
there. Can't say if that's a realistic failure in practice, but bumped into this in CI with Linux
when tried using 'fr_FR` (for another test). I figure not mentioning any language is safest.

icing added 2 commits May 26, 2026 16:03
Otherwise we may get a different month name in the output.
@icing icing force-pushed the test1981-locale-explicit branch from adecc36 to 8d31cb5 Compare May 26, 2026 14:07
@testclutch

This comment was marked as outdated.

@vszakats vszakats closed this in 90a7732 May 26, 2026
@vszakats
Copy link
Copy Markdown
Member

Thanks @icing, merged!

vszakats added a commit that referenced this pull request May 26, 2026
- fix macOS locale tests to clear existing variables.
  (Without this, the system-defined `LC_ALL` takes precedence, and
  the custom envs in CI are ignored.)

- trigger test 1981 issue by setting `LC_TIME` to non-English, on macOS.
  (On Linux it'd require explicitly installing a non-English locale, I
  skipped this for simplicity.)
  ```
  [...]
  -Time: 01/Aug/2025 08:31:43.037103 +0000 UTC[CR][LF]
  +Time: 01/ao%c3%bb/2025 08:31:43.037103 +0000 UTC[CR][LF]
  [...]
  FAIL 1981: '%time output with --write-out' HTTP, HTTP GET
  ```
  Follow-up to 90a7732 #21749

Follow-up to 1cc8a52 #17988
Follow-up to c221c0e #17938

Closes #21753
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Otherwise we may get a different month name in the output.

Closes curl#21749
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
- fix macOS locale tests to clear existing variables.
  (Without this, the system-defined `LC_ALL` takes precedence, and
  the custom envs in CI are ignored.)

- trigger test 1981 issue by setting `LC_TIME` to non-English, on macOS.
  (On Linux it'd require explicitly installing a non-English locale, I
  skipped this for simplicity.)
  ```
  [...]
  -Time: 01/Aug/2025 08:31:43.037103 +0000 UTC[CR][LF]
  +Time: 01/ao%c3%bb/2025 08:31:43.037103 +0000 UTC[CR][LF]
  [...]
  FAIL 1981: '%time output with --write-out' HTTP, HTTP GET
  ```
  Follow-up to 90a7732 curl#21749

Follow-up to 1cc8a52 curl#17988
Follow-up to c221c0e curl#17938

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

Labels

Development

Successfully merging this pull request may close these issues.

3 participants