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 marc1nr
Recipients marc1nr
Date 2018-10-04.15:13:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538666033.36.0.545547206417.issue34894@psf.upfronthosting.co.za>
In-reply-to
Content
If we use pickle.HIGHEST_PROTOCOL we can pickle lxml.etree.Element object but unpickling give us misleading error description:

>>> from lxml import etree
>>> import pickle
>>> import sys
sys.version
'2.7.15rc1 (default, Apr 15 2018, 21:51:34) \n[GCC 7.3.0]'
>>> etree.__version__
u'4.2.5'
>>> pickled = pickle.dumps(etree.Element('x'), protocol=pickle.HIGHEST_PROTOCOL)
>>> pickle.loads(pickled)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    pickle.loads(pickled)
  File "src/lxml/etree.pyx", line 1131, in lxml.etree._Element.__repr__
  File "src/lxml/etree.pyx", line 981, in lxml.etree._Element.tag.__get__
  File "src/lxml/apihelpers.pxi", line 19, in lxml.etree._assertValidNode
AssertionError: invalid Element proxy at 140260172089392


See also: https://bugs.launchpad.net/lxml/+bug/736708
History
Date User Action Args
2018-10-04 15:13:53marc1nrsetrecipients: + marc1nr
2018-10-04 15:13:53marc1nrsetmessageid: <1538666033.36.0.545547206417.issue34894@psf.upfronthosting.co.za>
2018-10-04 15:13:53marc1nrlinkissue34894 messages
2018-10-04 15:13:53marc1nrcreate