Roundup Robot added the comment:
New changeset 5b36768b9a11 by Eli Bendersky in branch '3.3':
Issue #16076: fix refleak in pickling of Element.
http://hg.python.org/cpython/rev/5b36768b9a11
New changeset 848738d3c40f by Eli Bendersky in branch 'default':
Close #16076: fix refleak in pickling of
Roundup Robot added the comment:
New changeset 4501813ea676 by Eli Bendersky in branch '3.3':
Issue #16076: check for return value of PyTuple_New for args (following
http://hg.python.org/cpython/rev/4501813ea676
New changeset 7313096e0bad by Eli Bendersky in branch 'default':
Issue #16076:
Ezio Melotti added the comment:
This is what I found out.
I used an easily copy/pastable one-liner that creates 3 variables: e (no
children), e2 (3 children), e3 (5 children).
Original leaky code (test_xml_etree_c leaked [56, 56] references, sum=112):
from xml.etree import ElementTree as ET;
Daniel Shahaf added the comment:
Ezio Melotti wrote on Fri, Jan 11, 2013 at 08:44:43 +:
### one ref leaked for every child in __setstate__:
e2.__setstate__(p2)
[76810 refs]
e2.__setstate__(p2)
[76813 refs]
e2.__setstate__(p2)
[76816 refs]
I'm not working on this anymore now, so
Roundup Robot added the comment:
New changeset 8d6dadfecf22 by Eli Bendersky in branch '3.3':
Issue #16076: make _elementtree.Element pickle-able in a way that is compatible
http://hg.python.org/cpython/rev/8d6dadfecf22
New changeset 4c268b7c86e6 by Eli Bendersky in branch 'default':
Issue
Eli Bendersky added the comment:
Fixed in 3.3 and default. Thanks for the good work, Daniel. A separate issue
can be opened for TreeBuilder.
--
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker
Roundup Robot added the comment:
New changeset c46054b49b6c by Eli Bendersky in branch '3.3':
Update Misc/NEWS for issue #16076
http://hg.python.org/cpython/rev/c46054b49b6c
--
___
Python tracker rep...@bugs.python.org
Ezio Melotti added the comment:
The fix introduced some refleaks:
$ ./python -m test -R3:2 test_xml_etree_c
test_xml_etree_c leaked [56, 56] references, sum=112
One seems to be in __getstate__:
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
--- a/Modules/_elementtree.c
+++
Daniel Shahaf added the comment:
Dissociating TreeBuilder from this issue per recent comments.
--
title: xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are
no longer pickleable - xml.etree.ElementTree.Element is no longer pickleable
Daniel Shahaf added the comment:
v8 removes TreeBuilder handling (code + tests) and removes memcpy per review.
(Outstanding issues in the review can be fixed post-v8, if needed.)
--
Added file: http://bugs.python.org/file28639/i16076-v8.diff
___
Daniel Shahaf added the comment:
Attached patch for your consideration.
I've tested pickling/unpickling and comparing the resulting object attribute by
attribute (.tag, .attrib, .text, .tail for equality; and recursively
.getchildren()), and 'make test' --- all seems to work.
If the approach
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: -serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
___
Santoso Wijaya added the comment:
OTOH, xml.etree.cElementTree.Element in Python 3.2 and earlier has never been
pickleable, either.
Python 3.2.3+ (3.2:24499eebbc2f, Oct 10 2012, 13:54:45)
[GCC 4.6.3] on linux2
Type help, copyright, credits or license for more information.
from
Santoso Wijaya added the comment:
This is because, in Python 3.3, xml.etree.ElementTree.Element is overridden by
the C accelerator version, _elementtree.Element.
If you remove the statement,
1708from _elementtree import *
the behavior from Python 3.2 comes back.
--
nosy:
Eli Bendersky added the comment:
Will look into it, thanks for the report.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
___
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
priority: high - normal
stage: needs patch -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
Changes by Jesús Cea Avión j...@jcea.es:
--
priority: normal - high
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
Changes by Antoine Pitrou pit...@free.fr:
--
priority: normal - high
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
Serhiy Storchaka added the comment:
In 3.2 repr(xml.etree.ElementTree.Element) is class
'xml.etree.ElementTree.Element'.
In 3.3 repr(xml.etree.ElementTree.Element) is class 'Element'.
--
versions: +Python 3.4
___
Python tracker
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
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
Changes by Serhiy Storchaka storch...@gmail.com:
--
components: +XML
keywords: +3.3regression
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +eli.bendersky, storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
___
Changes by Einar Fløystad Dørum eina...@gmail.com:
--
components: -Library (Lib)
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
___
25 matches
Mail list logo