Set the locale for test1981 explicit#21749
Conversation
|
Is there a good env that reproduces this? (tried a few without success) edit: was enough to write this msg, now I got one that triggers locally: |
|
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. |
| </features> | ||
| <setenv> | ||
| CURL_TIME=1754037103 | ||
| LC_ALL=en |
There was a problem hiding this comment.
| 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.
There was a problem hiding this comment.
Fixed. (I resisted debating how testing for "Aug" as month is "language-agnostic" but it is just too hot. 😌
There was a problem hiding this comment.
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.
Otherwise we may get a different month name in the output.
adecc36 to
8d31cb5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
Thanks @icing, merged! |
- 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
Otherwise we may get a different month name in the output. Closes curl#21749
- 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
Otherwise we may get a different month name in the output.