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 serhiy.storchaka
Recipients eli.bendersky, scoder, serhiy.storchaka, vstinner
Date 2017-09-13.18:20:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505326842.09.0.440337106549.issue31455@psf.upfronthosting.co.za>
In-reply-to
Content
Oh, I see many other issues with C implementation of ElementTree.

1. If XMLParser.__init__ is called twice, it leaks references and the Expat parser.

Possible solution: use the Py_XSETREF() macro instead of simple assignment. The Expat parser needs special handling.

Other possible solution: drop __init__() and make all initialization in __new__(). But this is a solution only for 3.7 because can break compatibility.

2. If XMLParser.__init__ is not called or if it fails to initialize the Expat parser, self->entity and self->target are NULL. Later in xmlparser_getattro() they are increfed unconditionally.
History
Date User Action Args
2017-09-13 18:20:42serhiy.storchakasetrecipients: + serhiy.storchaka, scoder, vstinner, eli.bendersky
2017-09-13 18:20:42serhiy.storchakasetmessageid: <1505326842.09.0.440337106549.issue31455@psf.upfronthosting.co.za>
2017-09-13 18:20:42serhiy.storchakalinkissue31455 messages
2017-09-13 18:20:42serhiy.storchakacreate