Bug: (Locale) IDLE/Tkinter/Python?

Blake Winton bwinton at tor.dhs.org
Wed Oct 6 11:34:10 EDT 1999


On Wed, 6 Oct 1999 12:15:16 GMT, Adrian Eyre wrote:
>I'm not sure how well Python copes with this generally, but
>changing my locale so that the thousands sep and decimals sep
>(normally ',' , '.') are reversed ('.' , ',') causes a problem
>in Tkinter, and therfore IDLE.
>
>But, for some reason, only in embedded code, not Python run from
>the commandline. Perhaps by default it ignores locale info.
>
>Traceback (innermost last):
>  File "C:\Progra~1\Python\Tools\idle\idle.py", line 2, in ?
>    import PyShell
>  File "C:\Progra~1\Python\Tools\idle\PyShell.py", line 12, in ?
>    from Tkinter import *
>  File "C:\Progra~1\Python\Lib\lib-tk\Tkinter.py", line 19, in ?
>    TkVersion = _string.atof(_tkinter.TK_VERSION)
>ValueError: invalid literal for atof(): 8.0

It almost looks like the problem is that Python is honouring the
seperators.  I would guess that _tkinter doesn't automatically generate
the TK_VERSION string, and is just storing it as the string "8.0".

So the easiest fix would probably be to just set the TkVersion yourself.
The nicest fix would be to find out if you can get at the major and
minor version numbers, and build the number yourself.

I wonder if the version number for Python is hardcoded the same way...

Later,
Blake.

-- 
One Will.  One Dream.  One Truth.  One Destiny.  One Love.
(I really gotta change this sometime soon...)




More information about the Python-list mailing list