[Python-bugs-list] [ python-Bugs-639266 ] Tkinter sliently discards all Tcl errors

noreply@sourceforge.net noreply@sourceforge.net
Sat, 16 Nov 2002 01:33:25 -0800


Bugs item #639266, was opened at 2002-11-16 08:35
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=639266&group_id=5470

Category: Tkinter
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Internet Discovery (idiscovery)
Assigned to: Nobody/Anonymous (nobody)
Summary: Tkinter sliently discards all Tcl errors

Initial Comment:

Tkinter silently discards all Tcl errors.  Athough this may make Tkinter programs
appear robust, it violates the fundamental principle that erros should be raised
and dealt with.

In Tkinter.py is the line

        self.tk.createcommand('tkerror', _tkerror)

where _tkerror is defined as

def _tkerror(err):
    """Internal function."""
    pass

This disables all uses of the tcl procedure bgerror from signalling
background errors to the user, including I assume any errors
generated in after_idle.



----------------------------------------------------------------------

>Comment By: Martin v. L÷wis (loewis)
Date: 2002-11-16 10:33

Message:
Logged In: YES 
user_id=21627

The qualification "silently discards all Tcl errors" is definitely 
incorrect:

>>> Tkinter.Label(foo="bar")
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in ?
    Tkinter.Label(foo="bar")
  File "E:\Python22\lib\lib-tk\Tkinter.py", line 2261, in __init__
    Widget.__init__(self, master, 'label', cnf, kw)
  File "E:\Python22\lib\lib-tk\Tkinter.py", line 1756, in __init__
    self.tk.call(
TclError: unknown option "-foo"

Instead, it would be more correct to say that all background 
errors are discarded.

Can you provide a script that demonstrates this problem? 
(i.e. one which behaves differently if the createcommand is 
removed from Tkinter.py)

Can you propose a solution for this problem? Please take 
into account that Tkinter behaved that way since the 
beginning, so any change must take backwards compatibility 
into account.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=639266&group_id=5470