[Python-bugs-list] [ python-Bugs-767228 ] Is pickle (cPickle) broken in 2.3b2 ?
SourceForge.net
noreply@sourceforge.net
Mon, 07 Jul 2003 10:18:15 -0700
Bugs item #767228, was opened at 2003-07-07 17:18
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=767228&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregor Mirai (gmirai)
Assigned to: Nobody/Anonymous (nobody)
Summary: Is pickle (cPickle) broken in 2.3b2 ?
Initial Comment:
The following code works correctly with 2.3b1 (on MacOS
X), but it throws KeyError: __getinitargs__ with 2.3b2 :
--------------------------------------------
#!/usr/bin/env python
import cPickle as c
class Style:
def __init__(self):
self.d = {}
def __setitem__(self, key, value):
self.d["d_"+key]=value
def __getattr__(self, key):
if key.startswith("d_"):
return self.d[key]
else:
return self.__dict__[key]
s = Style()
s["A"] = "B"
print s.d_A
print c.dumps(s)
--------------------------------------------
The problem shows with any class that should override
__getattr__ attribute.
So it seems that pickle is broken in the new release ?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=767228&group_id=5470