[Stackless] Fwd: error during pickling

lars van Gemerden lars at rational-it.com
Tue Oct 22 21:47:05 CEST 2013


A question i got from Wing when i contacted them about the test case below.
Can someone help John, I am not really the right guy.

Cheers, Lars

PS:  I'll also put the error trace below.

---------- Forwarded message ----------
From: Wing IDE Support <support at wingware.com>
Date: Tue, Oct 22, 2013 at 9:04 PM
Subject: Re: error during pickling
To: lars van Gemerden <lars at rational-it.com>


On 10/22/13 1:54 PM, lars van Gemerden wrote:

> Hi John,
>
> Did some digging in the trace and have an example now:
>
> ------------------------------**------------------------------
> import pickle
>
> class Test(object):
>      def __init__(self):
>          self.func = self.func2
>      def func2(self):
>          print "something"
>


> if __name__ == '__main__':
>      t = Test()
>      t.func()
>      s = pickle.dumps(t)
>      print s
>

Is stackless supposed to pickle the globals when pickling an instance like
this?  I'm just wondering if things are working as designed.

Thanks,

John

trace:

pickle.PicklingError: Can't pickle <built-in function wingdb_import_hook>:
it's not found as tdbgtracer27stackless.wingdb_import_hook
File
"d:\Documents\Code\python\floware\toolshed\tests\stackless_error_test.py",
line 12, in <module>
  s = pickle.dumps(t)
File "C:\Python27\lib\pickle.py", line 1411, in dumps
  Pickler(file, protocol).dump(obj)
File "C:\Python27\lib\pickle.py", line 231, in dump
  self.save(obj)
File "C:\Python27\lib\pickle.py", line 338, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\lib\pickle.py", line 426, in save_reduce
  save(state)
File "C:\Python27\lib\pickle.py", line 293, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\lib\pickle.py", line 661, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\lib\pickle.py", line 675, in _batch_setitems
  save(v)
File "C:\Python27\lib\pickle.py", line 338, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\lib\pickle.py", line 408, in save_reduce
  save(args)
File "C:\Python27\lib\pickle.py", line 293, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\lib\pickle.py", line 569, in save_tuple
  save(element)
File "C:\Python27\lib\pickle.py", line 293, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\lib\pickle.py", line 802, in save_function
  return self.save_reduce(obj=obj, *rv)
File "C:\Python27\lib\pickle.py", line 426, in save_reduce
  save(state)
File "C:\Python27\lib\pickle.py", line 293, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\lib\pickle.py", line 569, in save_tuple
  save(element)
File "C:\Python27\lib\pickle.py", line 293, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\lib\pickle.py", line 651, in save_dict
  return self.save_reduce(*modict_saver)
File "C:\Python27\lib\pickle.py", line 408, in save_reduce
  save(args)
File "C:\Python27\lib\pickle.py", line 293, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\lib\pickle.py", line 569, in save_tuple
  save(element)
File "C:\Python27\lib\pickle.py", line 338, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\lib\pickle.py", line 407, in save_reduce
  save(func)
File "C:\Python27\lib\pickle.py", line 293, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\lib\pickle.py", line 760, in save_global
  (obj, module, name))


-- 
====================================
Lars van Gemerden
lars at rational-it.com
+31 6 26 88 55 39
====================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20131022/6de27571/attachment.html>


More information about the Stackless mailing list