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.

classification
Title: Crash when using pickle and ElementTree
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eli.bendersky Nosy List: Arfrever, Kronuz, eli.bendersky, python-dev, scoder
Priority: normal Keywords: patch

Created on 2013-09-10 13:49 by Kronuz, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
houses.xml Kronuz, 2013-09-10 13:49 XML test file
join_obj.diff Kronuz, 2013-09-10 16:49 Fixes getstate/setstate
Messages (6)
msg197440 - (view) Author: Germán Méndez Bravo (Kronuz) * Date: 2013-09-10 13:49
On the tip of 3.3, I've found `Element.__getstate__` doesn't work and neither as `pickle.dumps(Element)` under certain circumstances.

This crashes:
  e1 = ElementTree().parse('houses.xml')
  e1.__getstate__()

This doesn't crash:
  e2 = ElementTree().parse('houses.xml')
  e2.text = 'some'
  e2.__getstate__()

But still, both of these crash:
  pickle.dumps(e1)
  pickle.dumps(e2)
msg197452 - (view) Author: Germán Méndez Bravo (Kronuz) * Date: 2013-09-10 15:52
The attached patch fixes the problem (there were some missing JOIN_OBJ())
msg197455 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-09-10 17:38
Thanks for this report, Germán (and the other issue as well). I'll do my best to take a look later this week.
msg197568 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-09-13 13:28
New changeset 39823ebfc731 by Eli Bendersky in branch '3.3':
Issue #18997: fix ElementTree crash with using pickle and __getstate__.
http://hg.python.org/cpython/rev/39823ebfc731

New changeset bda5a87df1c8 by Eli Bendersky in branch 'default':
Merge for Issue #18997: Issue #18997: fix ElementTree crash with using pickle and __getstate__.
http://hg.python.org/cpython/rev/bda5a87df1c8
msg197570 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-09-13 13:28
Fixed the patch and committed. Thanks.
msg198012 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-09-18 10:13
New changeset 111a74819192 by doko in branch '3.3':
- followup for issue #18997, make _clear_joined_ptr static.
http://hg.python.org/cpython/rev/111a74819192

New changeset 269be4aacb8e by doko in branch 'default':
- followup for issue #18997, make _clear_joined_ptr static.
http://hg.python.org/cpython/rev/269be4aacb8e
History
Date User Action Args
2022-04-11 14:57:50adminsetgithub: 63197
2013-09-18 10:13:36python-devsetmessages: + msg198012
2013-09-13 13:28:41eli.benderskysetstatus: open -> closed
resolution: fixed
messages: + msg197570

stage: patch review -> resolved
2013-09-13 13:28:12python-devsetnosy: + python-dev
messages: + msg197568
2013-09-10 21:02:12Arfreversetnosy: + Arfrever
2013-09-10 17:38:02eli.benderskysetversions: + Python 3.4
messages: + msg197455

assignee: eli.bendersky
type: behavior
stage: patch review
2013-09-10 16:49:26Kronuzsetfiles: + join_obj.diff
2013-09-10 16:48:31Kronuzsetfiles: - join_obj.diff
2013-09-10 15:52:49Kronuzsetfiles: + join_obj.diff
keywords: + patch
messages: + msg197452
2013-09-10 13:49:20Kronuzcreate