[New-bugs-announce] [issue16076] xml.etree.ElementTree.Element is no longer pickleable

Einar Fløystad Dørum report at bugs.python.org
Fri Sep 28 10:54:59 CEST 2012


New submission from Einar Fløystad Dørum:

The xml.etree.ElementTree.Element class is no longer pickleable in Python 3.3.0rc3 . 

This is a regression from Python 3.2 where the Element class was pickleable, while the xml.etree.cElementTree.Element was not. So this is probably related to switching the ElementTree implementation in Python 3.3.

I've looked at the "what's new" documentation in Python 3.3, and there was nothing that indicated that the ElemenTree switchover would give this kind of issues.  

I've run into this issues because I use the multiprocessing module to pass parsed XML documents between processes, and when I can't pickle Element objects. This stops working. 

You can reproduce the issue with the following code:
import pickle
from xml.etree.ElementTree import Element

print(pickle.dumps(Element("foo")))

----------
components: Library (Lib)
messages: 171418
nosy: einarfd
priority: normal
severity: normal
status: open
title: xml.etree.ElementTree.Element is no longer pickleable
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16076>
_______________________________________


More information about the New-bugs-announce mailing list