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
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.
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 :-