[Mailman-Developers] invite/confirm traceback

Barry Warsaw barry at python.org
Tue Jun 3 17:10:33 EDT 2003


On Mon, 2003-06-02 at 23:11, Fil wrote:
> I'm experimenting an "invite_members" command-line script derived from the
> add_members script. It does send a request for confirmation, but the
> confirmation email does not get processed, and no traceback show up in the
> logs. However, if I try the web confirmation, I get this traceback.

Without seeing your code, it's hard for me to tell exactly what the bug
is, but let me explain a little about how pickles work.

When you pickle an instance, Python really pickles the object's data
members and a reference to the object's class -- not the class itself. 
This reference is in the form of a string such as
"Mailman.UserDesc.UserDesc".  Upon unpickling, Python will attempt to
import e.g. UserDesc from Mailman.UserDesc.

Things that can foul this up include pickling a class nested inside a
function or another class.  In those cases, Python won't be able to
write the correct reference, or find the right imports to satisfy the
class reference.

The moral of the story is to make sure all the classes of the object you
want to pickle are defined at global scope.  Mailman.UserDesc.UserDesc
ought to satisfy that requirement, but maybe you've done something funky
in your script?

-Barry





More information about the Mailman-Developers mailing list