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 gregorlingl
Recipients gregorlingl, loewis
Date 2008-11-18.22:17:03
SpamBayes Score 3.4308112e-12
Marked as misclassified No
Message-id <1227046625.25.0.770059984491.issue4116@psf.upfronthosting.co.za>
In-reply-to
Content
I'd like to see this patch accepted and done for Python 2.6.1 and (at
the same time) python 3.0 before the last rc is released. So could you
dedicate a few minutes to reviewing it.

To demonstrate the nature of this issue (and also the nuisance it could
produce) I've constructed a minimal example to show the consequences of
the bug:

import turtle

s = turtle.Screen()

def changecolor():
    s.bgcolor(1.0, 0.5)  # needs 3 floats as arguments

s.ontimer(changecolor, 1000)
turtle.mainloop()

This should create an error message like this:
....
TurtleGraphicsError: bad color arguments: (100, 100)

Instead it results in:

Traceback (most recent call last):
  File "C:\_\provoke_error.py", line 11, in <module>
    turtle.mainloop()
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 325, in mainloop
    _default_root.tk.mainloop(n)
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 1414, in __call__
    self.widget._report_exception()
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 1175, in _report_exception
    root = self._root()
AttributeError: _Root instance has no __call__ method

because the _root() method defined in line 1105 of Tkinter.py is
overwritten by the _root attribute of ScrolledCanvas (lines 362 and
382). So in these (hopefully rare) cases where an error message is
directly provoked from the Tkinter module, this will fail letting the
user without clue about what happened. 

With the proposed patch applied, the above script produces the correct
error message.

Regards, Gregor
History
Date User Action Args
2008-11-18 22:17:05gregorlinglsetrecipients: + gregorlingl, loewis
2008-11-18 22:17:05gregorlinglsetmessageid: <1227046625.25.0.770059984491.issue4116@psf.upfronthosting.co.za>
2008-11-18 22:17:04gregorlingllinkissue4116 messages
2008-11-18 22:17:03gregorlinglcreate