[Patches] [ python-Patches-707701 ] fix for #698517, Tkinter and tk8.4.2

SourceForge.net noreply@sourceforge.net
Sun, 23 Mar 2003 04:07:11 -0800


Patches item #707701, was opened at 2003-03-21 20:36
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=707701&group_id=5470

Category: Tkinter
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 7
Submitted By: Matthias Klose (doko)
>Assigned to: Martin v. Löwis (loewis)
Summary: fix for #698517, Tkinter and tk8.4.2

Initial Comment:
[all python version, that can be built with tk8.4.2]

Fixing the failing conversions in _substitute. Use
try/except for each integer field, that is not
supported by all events.


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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-03-23 13:07

Message:
Logged In: YES 
user_id=21627

What is the problem that this patch solves?

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

Comment By: Matthias Klose (doko)
Date: 2003-03-22 08:26

Message:
Logged In: YES 
user_id=60903

Attach alternate patch by Chad


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

Comment By: Matthias Klose (doko)
Date: 2003-03-21 23:15

Message:
Logged In: YES 
user_id=60903

Attach alternate patch by Chad


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

Comment By: Chad Netzer (chadn)
Date: 2003-03-21 23:10

Message:
Logged In: YES 
user_id=40145

Hmmm, you are right.  Your approach will be quicker, due to
local namespace function lookup speed (try/except is fast in
non-exception path).

But, then again, a lot more exception paths will be executed
with the new Tk (with "??" fields), anyway, so the speed
issues may not be that important.


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

Comment By: Matthias Klose (doko)
Date: 2003-03-21 22:14

Message:
Logged In: YES 
user_id=60903

I thought the whole thing to define getint = int was to do
local lookups only. Therefore the inlined try/excepts


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

Comment By: Chad Netzer (chadn)
Date: 2003-03-21 21:59

Message:
Logged In: YES 
user_id=40145

Would it be better to simply define getint() as:

def getint( s ):
    try:
        return int( s )
    except ValueError:
        return s

Rather than add lots of try/excepts in the codebase?
I'm attaching an example diff (btw - I kept your field
explanations in the code; I liked them there)

These patches are important, BTW, since 8.4.1 has a few bugs
that would require other patches to Tkinter (returning ""
for getboolean for example, which seems to be fixed)


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

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