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 eli.bendersky
Recipients Arfrever, danielsh, einarfd, eli.bendersky, ezio.melotti, flox, georg.brandl, jcea, larry, python-dev, santoso.wijaya, skrah
Date 2013-01-03.14:44:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAF-Rda_comZDVpFmvzqRn6A2k2Xm1TnZiJVf6pzR07iRG-=8Uw@mail.gmail.com>
In-reply-to <20130101225642.GB3402@lp-shahaf.local>
Content
On Tue, Jan 1, 2013 at 2:56 PM, Daniel Shahaf <report@bugs.python.org>wrote:

>
> Daniel Shahaf added the comment:
>
> Eli Bendersky wrote on Tue, Jan 01, 2013 at 15:54:00 +0000:
> > Why did you change the class name, by the way, I don't think it's
> > a valid change at least for 3.3 in terms of backwards compatibility.
> >
>
> With unmodified tip of 3.4:
>
>     >>> import pickle, xml.etree.ElementTree as ET
>     >>> pickle.dumps(ET.Element('foo'))
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     _pickle.PicklingError: Can't pickle <class 'Element'>: attribute
> lookup builtins.Element failed
>
> I added the "_elementtree" to the tp_name in order to bypass the above
> error.  Module-qualified names were in use elsewhere (including by
> _elementtree._element_iterator) so it seemed reasonable.  I'll defer to
> you about compatibility implications of this change.

I asked on pydev, but this is a key point to resolve. Can
pickling/unpickling be made to work correctly without such (or similar)
change at all? How will the unpickler know which module to load when it
sees a pickled object of Element type?

If this change is required (even if we choose to name it
"xml.etree.ElementTree.Element" for Py compatibility to fix the pickling
regression, we may find ourselves in a need to change it between 3.3 and
3.3.1 and I'm not sure if that's valid. I hope my question on pydev will be
resolved conclusively.

Danial, could you investigate if such a change is absolutely required to
make pickling/unickling of Element work?
History
Date User Action Args
2013-01-03 14:44:02eli.benderskysetrecipients: + eli.bendersky, georg.brandl, jcea, larry, ezio.melotti, Arfrever, skrah, flox, santoso.wijaya, python-dev, einarfd, danielsh
2013-01-03 14:44:02eli.benderskylinkissue16076 messages
2013-01-03 14:44:02eli.benderskycreate