[Stackless] Fwd: deepcopying (pickling) channels

Kristján Valur Jónsson kristjan at ccpgames.com
Sat Oct 26 12:49:35 CEST 2013

Modules should be pickled by name.
This is what happens during normal pickling by stackless.

-----Original Message-----
From: stackless-bounces at stackless.com [mailto:stackless-bounces at stackless.com] On Behalf Of John Ehresman
Sent: 25. október 2013 16:37
To: The Stackless Python Mailing List
Subject: Re: [Stackless] Fwd: deepcopying (pickling) channels

On 10/25/13 11:44 AM, Kristján Valur Jónsson wrote:
> Did anyone attempt to patch pickle.py as suggested below, to diagnose the pickling problem?
> Once you arrive at a problem, it is useful to know the chain of objects it is working with.

Running in the debugger does break when the exception is raised.  It's raised when pickling the module due to a dictionary returned from a reduce function in the copy_reg.dispatch_table for module objects.  The reduce function is written in C (in Stackless/pickling/prickelpit.c) and gets the __import__ hook out of builtins.

I can probably fix the pickle error (I've hacked a fix locally), but the questions I have are essentially why is the __import__ hook saved and how/when is it used?  I worry that a fix for the pickling problem might lead to other, more obscure, problems later.



Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list