Embedded Python and MySQLdb (was Re: PyApache and MySQLdb (was Re: anyone get one of the python apache modules to work with 2.1?))

Brandon Long blong at fiction.net
Thu Aug 30 20:31:35 EDT 2001


On 08/29/01 Brandon Long uttered the following other thing:
> On 08/29/01 Skip Montanaro uttered the following other thing:
> > 
> >     >> Sounds like something's fishy in your os module.
> >     ...
> >     Brandon> No, the module is unmodified and does contain the
> >     Brandon> AttributeError clause... but for some reason, it doesn't match
> >     Brandon> the AttributeError exception that is thrown.  If I replace it
> >     Brandon> with just except: to catch all exceptions, it passes until
> >     Brandon> further down where something else in os.py expects an
> >     Brandon> exception.
> > 
> > This sounds very odd.  If you print out sys.exc_info() inside the except:
> > clause what do you see as an error?  Is there anything unusual about your
> > install?  Does "make test" from your build directory run pretty cleanly?
> 
> The first time through (when it doesn't fail):
> (<class exceptions.AttributeError at 0x80c807c>,
> <exceptions.AttributeError instance at 0x8151dc4>, <traceback object at
> 0x81506e0>)
> 
> The second time through:
> (<class exceptions.AttributeError at 0x81635e4>,
> <exceptions.AttributeError instance at 0x8178f04>, <traceback object at
> 0x80d01c0>)

Ok, here's the revelation:
(<class exceptions.AttributeError at 0x817b59c>, <exceptions.AttributeError instance at 0x818a04c>, <traceback object at
0x8189b38>)
AttributeError = <class exceptions.AttributeError at 0x80c807c>
exceptions.AttributeError = <class exceptions.AttributeError at 0x817b59c>

Ie, exceptions.AttributeError and AttributeError don't match.

MySQLdb isn't required.  All that has to happen to cause this is to
import the exceptions module.

Brandon
-- 
   "Cui merda tollenda erit?"               
                                           http://www.fiction.net/blong/




More information about the Python-list mailing list