Artifacts Associated With Ticket fcd3dadd79
Ticket change [0ad32f3347] (rid 254629) by serhiy.storchaka on 2026-06-30 08:59:10:
- cmimetype initialized to: "text/x-markdown"
- comment initialized to:
`format` converts floating-point values with the C library function `snprintf` (generic/tclStringObj.c, `Tcl_AppendFormatToObj`), which honours `LC_NUMERIC`. Under a comma-decimal locale, `format` emits a value that Tcl then refuses to parse, because its own number parser is locale-independent: % format %.1f 0.3 0,3 % expr {[format %.1f 0.3] + 0} expected floating-point number but got "0,3" Tcl resets `LC_NUMERIC` to `"C"` at init, so this only shows up under an embedder that sets a comma locale afterwards - for example a Python/tkinter program calling `locale.setlocale(locale.LC_NUMERIC, "de_DE.UTF-8")`. `Tcl_GetDoubleFromObj` and `Tcl_PrintDouble` are already locale-independent (`Tcl_PrintDouble` was fixed in <https://core.tcl-lang.org/tcl/tktview/3120139>); only `format` still leaks the locale. Making its floating-point conversions locale-independent (always `.`) would match that precedent and the new Tk helper `TkFormatDouble` (<https://core.tcl-lang.org/tk/tktview/348b482ff73e>). Concrete fallout: `ttk::spinbox` formats its value with `[format $fmt $val]`, so under a comma locale it writes `"0,3"` into its `-textvariable` and breaks (reported downstream as CPython issue <https://github.com/python/cpython/issues/84008>; the ttk-side remainder of the Tk fix above). - foundin initialized to: "8.6, 8.7, 9.0, 9.1"
- status initialized to: "Open"
- submitter initialized to: "serhiy.storchaka"
- subsystem initialized to: "16. Commands A-H"
- title initialized to:
format honours LC_NUMERIC for %f/%g, producing numbers Tcl cannot parse
- type initialized to: "Bug"
Ticket change [64f052c3f1] (rid 254630) by jan.nijtmans on 2026-06-30 09:36:57:
- assignee changed to: "jan.nijtmans"
- closer changed to: "nobody"
- comment changed to:
`format` converts floating-point values with the C library function `snprintf` (generic/tclStringObj.c, `Tcl_AppendFormatToObj`), which honours `LC_NUMERIC`. Under a comma-decimal locale, `format` emits a value that Tcl then refuses to parse, because its own number parser is locale-independent: % format %.1f 0.3 0,3 % expr {[format %.1f 0.3] + 0} expected floating-point number but got "0,3" Tcl resets `LC_NUMERIC` to `"C"` at init, so this only shows up under an embedder that sets a comma locale afterwards - for example a Python/tkinter program calling `locale.setlocale(locale.LC_NUMERIC, "de_DE.UTF-8")`. `Tcl_GetDoubleFromObj` and `Tcl_PrintDouble` are already locale-independent (`Tcl_PrintDouble` was fixed in <https://core.tcl-lang.org/tcl/tktview/3120139>); only `format` still leaks the locale. Making its floating-point conversions locale-independent (always `.`) would match that precedent and the new Tk helper `TkFormatDouble` (<https://core.tcl-lang.org/tk/tktview/348b482ff73e>). Concrete fallout: `ttk::spinbox` formats its value with `[format $fmt $val]`, so under a comma locale it writes `"0,3"` into its `-textvariable` and breaks (reported downstream as CPython issue <https://github.com/python/cpython/issues/84008>; the ttk-side remainder of the Tk fix above). - login: "jan.nijtmans"
- mimetype: "text/plain"
- priority changed to: "1 Zero"
- resolution changed to: "None"
- severity changed to: "Minor"
Ticket change [18b84ca638] (rid 254670) by oehhar on 2026-07-01 07:05:23:
- icomment:
I suppose, Jan forgot to write here, that he has fixed this with commit [12306649fb]. Serhiy, could you verify and close the ticket if ok? Thanks, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [10c7523b04] (rid 254902) by jan.nijtmans on 2026-07-14 10:52:29:
- closedate changed to: "2461235.9531141669"
- closer changed to: "jan.nijtmans"
- icomment:
Let's just close this. Re-open (or a new ticket) when a new problem is found
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"