This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients eli.bendersky, poojariravi, scoder, serhiy.storchaka
Date 2017-09-14.10:45:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505385935.85.0.372691904832.issue31467@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-09-14 10:45:35serhiy.storchakasetrecipients: + serhiy.storchaka, scoder, eli.bendersky, poojariravi
2017-09-14 10:45:35serhiy.storchakasetmessageid: <1505385935.85.0.372691904832.issue31467@psf.upfronthosting.co.za>
2017-09-14 10:45:35serhiy.storchakalinkissue31467 messages
2017-09-14 10:45:35serhiy.storchakacreate