Python 2.1 Bug (was Re: 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 21:00:53 EDT 2001


On 08/30/01 Brandon Long uttered the following other thing:
> 
> 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.

Bug found.  In Python/pythonrun.c:Py_Initialize() there should be a call
to _PyImport_FixupExtension() for the exceptions module after
init_exceptions().  Ie:

--- Python/pythonrun.c	Mon Mar 26 11:53:38 2001
+++ Python/pythonrun.c.new	Thu Aug 30 17:59:43 2001
@@ -144,6 +144,7 @@
 
 	/* initialize builtin exceptions */
 	init_exceptions();
+	_PyImport_FixupExtension("exceptions", "exceptions");
 
 	/* phase 2 of builtins */
 	_PyImport_FixupExtension("__builtin__", "__builtin__");


Brandon
-- 
 "Some people have one-track gutters." -- Harlan Ellison
                                           http://www.fiction.net/blong/




More information about the Python-list mailing list