[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2021-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue12558 which exposes the other side of the same issue. Las time I looked at it, it was inherently a Tcl issue. In some places it uses locale-dependent formatting of floating point numbers, but locale-unaware parsing, or vice versa. --

[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2021-08-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: I wrote a longer explanation but BPO and Chrome ate it. The issue is that DoubleVar is not locale aware. I don't know what should be the actual fix but the following may be a useful workaround (It works on my system): import tkinter import locale import sys

[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2020-06-12 Thread E. Paine
E. Paine added the comment: Is this a problem exclusive to tkinter? I ran the following code, and it appears to be an issue with the builtin 'float' method: >>> import locale >>> locale.setlocale(locale.LC_NUMERIC, 'de_DE.utf8') 'de_DE.utf8' >>> float("1,2") ValueError: could not convert stri

[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2020-03-07 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2020-03-04 Thread Till Korten
Till Korten added the comment: I just found the following code in lines 314-320 of [tkinter/ttk.py](https://github.com/python/cpython/blob/master/Lib/tkinter/ttk.py), which are clearly not localization-aware: ``` def _to_number(x): if isinstance(x, str): if '.' in x: x

[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2020-03-02 Thread Till Korten
New submission from Till Korten : This issue occurs when a locale is set that uses comma as decimal separator (e.g. locale.setlocale(locale.LC_NUMERIC, 'de_DE.utf8')). I have a tkinter.Spinbox with increment=0.1 connected to a tkinter.DoubleVar. When I change the value of the Spinbox using the