Issue 57 in netaddr: netaddr objects can't pickle

2 views
Skip to first unread message

codesite...@google.com

unread,
Aug 27, 2010, 1:17:46 AM8/27/10
to net...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 57 by fullung: netaddr objects can't pickle
http://code.google.com/p/netaddr/issues/detail?id=57

import pickle; import netaddr; pickle.dumps(netaddr.IPAddress(0))

What is the expected output? What do you see instead?

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/python27/lib/python2.7/pickle.py", line 1374, in dumps
Pickler(file, protocol).dump(obj)
File "/opt/python27/lib/python2.7/pickle.py", line 224, in dump
self.save(obj)
File "/opt/python27/lib/python2.7/pickle.py", line 331, in save
self.save_reduce(obj=obj, *rv)
File "/opt/python27/lib/python2.7/pickle.py", line 419, in save_reduce
save(state)
File "/opt/python27/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/opt/python27/lib/python2.7/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
File "/opt/python27/lib/python2.7/pickle.py", line 663, in _batch_setitems
save(v)
File "/opt/python27/lib/python2.7/pickle.py", line 306, in save
rv = reduce(self.proto)
File "/opt/python27/lib/python2.7/copy_reg.py", line 70, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle module objects

What version of the product are you using? On what operating system?

python-netaddr-0.5.2-1.el5
python-netaddr-0.7.2-1.fc12.noarch

codesite...@google.com

unread,
Aug 27, 2010, 6:48:39 AM8/27/10
to net...@googlegroups.com
Updates:
Labels: -Type-Defect Type-Enhancement

Comment #1 on issue 57 by drkjam: netaddr objects can't pickle
http://code.google.com/p/netaddr/issues/detail?id=57

Interesting. I will have a look at this with a view to fixing it for the
next release.

codesite...@google.com

unread,
Sep 14, 2010, 8:17:06 PM9/14/10
to net...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 57 by drkjam: netaddr objects can't pickle
http://code.google.com/p/netaddr/issues/detail?id=57

Fixed in 0.7.x branch on github available here :-

http://github.com/drkjam/netaddr

Reply all
Reply to author
Forward
0 new messages