New submission from Marcin Raczyński :
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 "", line 1, in
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
--
components: Library (Lib)
messages: 327054
nosy: marc1nr
priority: normal
severity: normal
status: open
title: Unexpected error while unpickling lxml.etree.Element object
type: behavior
versions: Python 2.7
___
Python tracker
<https://bugs.python.org/issue34894>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com