[Tutor] debugging approach for shimmed classes

Hal Wine hal at dtor.com
Wed Jan 14 00:35:02 EST 2004


[I heard about this list at the Bay Piggies meeting, so I'm a first time 
poster.]

I just slogged through a painful debugging session, and would love to 
learn of a better way to do it.

I was trying out newsbot (on jabberstudio.org) to talk to a jabber 
server I run. The difference is I run an SSL only server. So I had to 
make some mods to newsbot to do to make it work on https.

However, it kept failing, reporting no SSL Support. I could connect with 
seemingly identical code to an https server on the same host. Finally, 
through use of print statements - I figured out that a sub module of 
newsbot used Timothy O'Malley's timeoutsocket.py to shim python's 
socket.socket method. That module has been incorporated into python 2.3, 
so there was a name space collision.

So, basically two questions:

1. What would be a better method than random print statements to find a 
problem cause by a shim installed elsewhere?

2. How should one write code to use a shim module only if it's not 
already part of python? I.e. how best do I modify the newsbot code to 
not use the shim under python 2.3 or later.

Thanks,
--Hal




More information about the Tutor mailing list