Message302165
This error is from cPickle.
>>> import xml.etree.cElementTree as ET
>>> root = ET.XML('<data/>')
>>> import pickle
>>> pickle.dumps(root)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/pickle.py", line 1380, in dumps
Pickler(file, protocol).dump(obj)
File "/usr/lib/python2.7/pickle.py", line 224, in dump
self.save(obj)
File "/usr/lib/python2.7/pickle.py", line 331, in save
self.save_reduce(obj=obj, *rv)
File "/usr/lib/python2.7/pickle.py", line 400, in save_reduce
save(func)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 754, in save_global
(obj, module, name))
pickle.PicklingError: Can't pickle <function copyelement at 0x7f8acaf5b758>: it's not found as __main__.copyelement
>>> import cPickle
>>> cPickle.dumps(root)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: expected string or Unicode object, NoneType found
cElementTree.Element is not pickleable in Python 2. And I think it is too later to add this feature in 2.7. The obvious solution -- use Python 3. |
|
Date |
User |
Action |
Args |
2017-09-14 10:45:35 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, scoder, eli.bendersky, poojariravi |
2017-09-14 10:45:35 | serhiy.storchaka | set | messageid: <1505385935.85.0.372691904832.issue31467@psf.upfronthosting.co.za> |
2017-09-14 10:45:35 | serhiy.storchaka | link | issue31467 messages |
2017-09-14 10:45:35 | serhiy.storchaka | create | |
|