Issue1538691
Created on 2006-08-11 13:27 by robinbryce2, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| patch_against_51208.diff | robinbryce2, 2006-08-11 13:27 | [PATCH] pyexpat.c, _elementtree.c & test_xml_etree_c.py | ||
| Messages (6) | |||
|---|---|---|---|
| msg50868 - (view) | Author: Robin Bryce (robinbryce2) | Date: 2006-08-11 13:27 | |
This patch provides to the 'current' position expat api via cElementTree.XMLTreeBuilder. pyexpat already exposes this via the attributes CurrentLineNumber, CurrentColumnNumber and CurrentByteIndex. In order for cElementTree to do the same, the following expat functions are added to those exported via the pyexpat capi: * XML_CurrentLineNumber * XML_CurrentColumnNumber * XML_CurrentByteIndex Then, in _elementtree.c, the xmlparser_getattr is made to mirror the provisions made in pyexpat. A trivial test is added to test_etree_c.py to cover the three new attributes. This patch was motivated by a discussion[1] on the turbogears list that referenced two xml templating libraries Kid & Markup. One of the benefits of the latter is the ability to report line numbers for template source errors. If this patch is applied it should be possible for Kid, and anything else that uses cElementTree for xmlparsing, to do the same. [1] http://groups.google.com/group/turbogears/browse_frm/thread/1ed59ed984fc8bbe/1f06eb00e83f93d9#1f06eb00e83f93d9 |
|||
| msg50869 - (view) | Author: Neal Norwitz (nnorwitz) * ![]() |
Date: 2006-08-11 23:56 | |
Logged In: YES user_id=33168 Fredrik, do you want etree patches here? |
|||
| msg85282 - (view) | Author: Fredrik Lundh (effbot) * ![]() |
Date: 2009-04-03 00:00 | |
In the upstream 1.0.6, the ParseError exception has a position attribute that contains a (line, column) tuple. |
|||
| msg85482 - (view) | Author: Georg Brandl (georg.brandl) * ![]() |
Date: 2009-04-05 11:18 | |
Which will be synced into core at some point, I guess? |
|||
| msg86120 - (view) | Author: Robin Bryce (robinbryce) | Date: 2009-04-18 15:10 | |
> In the upstream 1.0.6, the ParseError exception has a position attribute > that contains a (line, column) tuple. That's fine for errors in the xml domain. Its not enough if I'm reporting errors in the application domain - where I wont have a handy exception to interrogate. What's the problem with just exposing the api and requiring users who need it to use the streaming parser ? Personally, I would have cached these details as a properties of the _ElementInterface implementation for precisely this use case. |
|||
| msg100859 - (view) | Author: Florent Xicluna (flox) * ![]() |
Date: 2010-03-11 14:49 | |
ElementTree fixed in 2.7. See #6472. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:19 | admin | set | github: 43808 |
| 2010-03-11 14:49:26 | flox | set | status: open -> closed superseder: Update ElementTree with upstream changes messages: + msg100859 dependencies:
- Update ElementTree with upstream changes |
| 2010-02-13 16:05:16 | flox | set | nosy:
+ flox |
| 2010-02-13 16:01:18 | flox | set | dependencies:
+ Update ElementTree with upstream changes versions: + Python 3.2, - Python 3.1 |
| 2009-04-18 15:10:55 | robinbryce | set | status: pending -> open nosy: + robinbryce messages: + msg86120 |
| 2009-04-05 11:18:31 | georg.brandl | set | status: open -> pending nosy:
+ georg.brandl resolution: postponed |
| 2009-04-03 00:00:51 | effbot | set | messages: + msg85282 |
| 2009-03-30 03:51:52 | ajaksu2 | set | stage: patch review type: enhancement components: + XML, - None versions: + Python 3.1, Python 2.7 |
| 2006-08-11 13:27:12 | robinbryce2 | create | |
