msg83521 - (view) |
Author: Jean-Paul Calderone (exarkun) *  |
Date: 2009-03-13 16:50 |
Lacking unit tests for this (documented) functionality makes it harder for alternate Python runtimes to correctly provide it. Plus, if it's not tested, it might not work. I tried to write tests for the feature since I recently used it and thought it would be pretty straightforward. However, I failed. expat inscrutably refuses to call the external entity ref handler I provided in my test. Attached is my attempted, in case anyone feels like helping complete it. |
|
|
msg83525 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2009-03-13 18:20 |
You need to make two changes: 1. Enable parsing of parameter entities in the first place, e.g. through SetParamEntityParsing(XML_PARAM_ENTITY_PARSING_ALWAYS) 2. Pass a well-formed document, e.g. "" |
|
|
msg83527 - (view) |
Author: Jean-Paul Calderone (exarkun) *  |
Date: 2009-03-13 18:32 |
Thanks, that helped a bunch. I'm sure it would have taken me a long time to find SetParamEntityParsing(XML_PARAM_ENTITY_PARSING_ALWAYS). Perhaps it would also be good to expand the pyexpat documentation to cover that method and parameter (unless it's there already and I missed it, but I don't think so). |
|
|
msg83530 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2009-03-13 19:09 |
Can you provide an update patch? |
|
|
msg83531 - (view) |
Author: Jean-Paul Calderone (exarkun) *  |
Date: 2009-03-13 19:11 |
Here's the version I have now. I don't think it's complete, but it finishes the test started in the previous patch, and the test passes. |
|
|
msg83532 - (view) |
Author: Jean-Paul Calderone (exarkun) *  |
Date: 2009-03-13 19:12 |
To clarify, I'll probably work on this patch a bit more later, adding a few more tests for related behavior. |
|
|
msg88130 - (view) |
Author: Jean-Paul Calderone (exarkun) *  |
Date: 2009-05-20 18:41 |
Here's a new patch which adds SetParamEntityParsing to the pyexpat library docs and adds another test for external entity reference handling. This is probably all I'll do on this ticket. |
|
|
msg125382 - (view) |
Author: Sandro Tosi (sandro.tosi) *  |
Date: 2011-01-04 23:27 |
Hi all, I think this patch would be nice to be applied, but before start working on it (like adapt it to new code & stuff), I'd like to know if we are really targetting 2.7 or should we instead targer 3.3. Cheers, Sandro |
|
|
msg125383 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2011-01-04 23:52 |
I don't think we should adding tests to 2.7, perhaps unless there are also fixes for it. So targetting 3.3+ only seems reasonable. |
|
|
msg125434 - (view) |
Author: Sandro Tosi (sandro.tosi) *  |
Date: 2011-01-05 16:56 |
Ok, I've changed the version field and refreshed the patch against py3k. |
|
|
msg125451 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-01-05 18:37 |
Doc patch committed in r87762. |
|
|
msg125452 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-01-05 18:45 |
Ok, I've changed "assertEquals" to "assertEqual" and committed the tests in r87765. Thank you! |
|
|