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

Till Korten report at bugs.python.org
Wed Mar 4 13:18:50 EST 2020


Till Korten <webmaster at korten.at> 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 = float(x)
        else:
            x = int(x)
    return x
```

I'll keep looking for similar stuff and add a pull request once I think I have nailed down the issue
I'll look for something similar in

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39827>
_______________________________________


More information about the Python-bugs-list mailing list