This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hans.bering
Recipients hans.bering
Date 2011-07-14.15:05:05
SpamBayes Score 2.072681e-11
Marked as misclassified No
Message-id <1310655906.95.0.630445767575.issue12558@psf.upfronthosting.co.za>
In-reply-to
Content
The attached script will crash on a current Ubuntu with Python 3.2 + tcl/tk when using a locale which uses a comma as a decimal separator (e.g., German). It will not crash when using a locale which uses a dot as the decimal separator (e.g., English). In case of the crash, the output and stacktrace are as follows:

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"

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).

The locale dependency can make this problem difficult to debug when it occurs. In our setup, we had a program work on one machine, but it crashed on the next machine, which we believed to have an identical setup; it took us a day to figure out what the difference was. We would expect the constructor to either always work with float arguments, or to always reject them, regardless of locale.

We have been able to reproduce this issue both with Python 2.7.2 and Python 3.2, both under a current Ubuntu and Windows 7.
History
Date User Action Args
2011-07-14 15:05:07hans.beringsetrecipients: + hans.bering
2011-07-14 15:05:06hans.beringsetmessageid: <1310655906.95.0.630445767575.issue12558@psf.upfronthosting.co.za>
2011-07-14 15:05:06hans.beringlinkissue12558 messages
2011-07-14 15:05:05hans.beringcreate