Re: [bug #68453] bash 5.3 on macOS (Homebrew): inconsistent locale handling e.g. in printf builtin
Grisha Levit <[email protected]> Fri, 19 Jun 2026 17:32:45 -0400
| Newsgroups | gmane.comp.shells.bash.bugs |
|---|---|
| Message-ID | <CAMu=BrqOoY1nS3y4bsk141HnnZUcyrXMoyVjzQgZVk5XdmhQtA@mail.gmail.com> |
On Fri, Jun 19, 2026 at 3:39=E2=80=AFPM Chet Ramey via Bug reports for the = GNU Bourne Again SHell <[email protected]> wrote: > I can't reproduce your results with bash-5.3, but I am not using Homebrew= . I can reproduce this if, in System Settings : Language & Region, I have: * "Region" set to "Germany" * "English" as the first entry in "Preferred Languages" Note that the language has to be "English" (or "English (UK)"), and not "English (US)". $ defaults read -g AppleLocale en_DE $ env -i ./bash -c \ "printf '%f\n' 1; LC_NUMERIC=3DC printf '%f\n' 2; printf '%f\n' 3" 1,000000 2.000000 ./bash: line 1: warning: setlocale: LC_NUMERIC: cannot change locale (): No such file or directory 3.000000 Setting LANG or LC_ALL instead of LC_NUMERIC in the temp env works as expected though: $ env -i ./bash -c \ "printf '%f\n' 1; LC_ALL=3DC printf '%f\n' 2; printf '%f\n' 3" 1,000000 2.000000 3,000000 As does setting LC_NUMERIC as a non-temp env variable: $ env -i ./bash -c \ "printf '%f\n' 1; LC_NUMERIC=3DC; printf '%f\n' 2; printf '%f\n' 3" 1,000000 2.000000 3.000000 I think the only unexpected behavior here is that undoing an LC category change done in the temp env doesn't work correctly. I see the same results with Bash from Homebrew and built from source.