Message139566
I have been able to reproduce this problem with a current Python 3.2 + tcl/tk on Ubuntu. I have attached a script which should crash with the following output & stacktrace (you might have to find & set a suitable locale depending on your OS):
locale = ('de_DE', 'UTF8')
Traceback (most recent call last):
File "tkinterCrash.py", line 20, in <module>
tkcanvas = Canvas(master=master, width=w, height=2, borderwidth=4)
File "/usr/lib/python3.2/tkinter/__init__.py", line 2101, in __init__
Widget.__init__(self, master, 'canvas', cnf, kw)
File "/usr/lib/python3.2/tkinter/__init__.py", line 1961, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: bad screen distance "10.0"
The problem seems to stem from the fact that tkinter passes the "width" option through regardless of what it is (you can set w to the string "hello" to get the same error), and somewhere below (in tk, I guess?), the option argument is tentatively parsed as a number using the system's numeric locale.
Originally, we stumbled over this problem when using matplotlib, which passes/passed down float types as width arguments on occasions. It has been fixed there since (see https://github.com/matplotlib/matplotlib/pull/387).
It's the locale dependency which can make this difficult to debug when it occurs. In our setup, we had a program running on one machine, and then it crashed on the next, which we believed to have an identical setup; it took us a day to figure out what the difference was. |
|
Date |
User |
Action |
Args |
2011-07-14 19:48:30 | terry.reedy | unlink | issue10647 messages |
2011-07-01 10:46:42 | hans.bering | set | recipients:
+ hans.bering, tim.golden, r.david.murray, brian.curtin, hfischer |
2011-07-01 10:46:42 | hans.bering | set | messageid: <1309517202.76.0.304486525861.issue10647@psf.upfronthosting.co.za> |
2011-07-01 10:46:42 | hans.bering | link | issue10647 messages |
2011-07-01 10:46:41 | hans.bering | create | |
|