Message302103
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. |
|
Date |
User |
Action |
Args |
2017-09-13 18:20:42 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, scoder, vstinner, eli.bendersky |
2017-09-13 18:20:42 | serhiy.storchaka | set | messageid: <1505326842.09.0.440337106549.issue31455@psf.upfronthosting.co.za> |
2017-09-13 18:20:42 | serhiy.storchaka | link | issue31455 messages |
2017-09-13 18:20:42 | serhiy.storchaka | create | |
|