can't pickle instancemethod objects

Jim Lewis jim.lewis at miclog.com
Sun Jul 9 10:06:25 EDT 2006


> How about you post the complete stack trace of the exception?

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\program files\python\lib\lib-tk\Tkinter.py", line 1345, in
__call__
    return self.func(*args)
  File "C:\Public\world.py", line 1832, in BtnGo
    DoBtnGo()
  File "C:\Public\world.py", line 1812, in DoBtnGo
    if DoPickle: SavePickle ()
  File "C:\Public\world.py", line 1817, in SavePickle
    pickle.dump (pop,f)
  File "C:\program files\python\lib\pickle.py", line 1382, in dump
    Pickler(file, protocol, bin).dump(obj)
  File "C:\program files\python\lib\pickle.py", line 231, in dump
    self.save(obj)
  File "C:\program files\python\lib\pickle.py", line 293, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\program files\python\lib\pickle.py", line 739, in save_inst
    save(stuff)
  File "C:\program files\python\lib\pickle.py", line 293, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\program files\python\lib\pickle.py", line 663, in save_dict
    self._batch_setitems(obj.iteritems())
  File "C:\program files\python\lib\pickle.py", line 677, in
_batch_setitems
    save(v)
  File "C:\program files\python\lib\pickle.py", line 293, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\program files\python\lib\pickle.py", line 614, in save_list
    self._batch_appends(iter(obj))
  File "C:\program files\python\lib\pickle.py", line 629, in
_batch_appends
    save(x)
  File "C:\program files\python\lib\pickle.py", line 293, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\program files\python\lib\pickle.py", line 739, in save_inst
    save(stuff)
  File "C:\program files\python\lib\pickle.py", line 293, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\program files\python\lib\pickle.py", line 663, in save_dict
    self._batch_setitems(obj.iteritems())
  File "C:\program files\python\lib\pickle.py", line 677, in
_batch_setitems
    save(v)
  File "C:\program files\python\lib\pickle.py", line 313, in save
    rv = reduce(self.proto)
  File "C:\program files\python\lib\copy_reg.py", line 69, in
_reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle instancemethod objects




More information about the Python-list mailing list