Commit Graph

95 Commits

Author SHA1 Message Date
Serhiy Storchaka 3b05ad7be0
bpo-34160: Preserve user specified order of Element attributes in html. (GH-10190) 2018-10-29 19:31:04 +02:00
Raymond Hettinger e3685fd5fd
bpo-34160: Preserve user specified order of Element attributes (GH-10163) 2018-10-28 11:18:22 -07:00
Serhiy Storchaka f081fd8303
bpo-35013: Add more type checks for children of Element. (GH-9944)
It is now guarantied that children of xml.etree.ElementTree.Element
are Elements (at least in C implementation). Previously methods
__setitem__(), __setstate__() and __deepcopy__() could be used for
adding non-Element children.
2018-10-19 12:12:57 +03:00
Serhiy Storchaka 02ec92fa7b
bpo-29209: Remove old-deprecated features in ElementTree. (GH-6769)
Also make getchildren() and getiterator() emitting
a DeprecationWarning instead of PendingDeprecationWarning.
2018-07-24 12:03:34 +03:00
Mike 53f7a7c281 bpo-32297: Few misspellings found in Python source code comments. (#4803)
* Fix multiple typos in code comments

* Add spacing in comments (test_logging.py, test_math.py)

* Fix spaces at the beginning of comments in test_logging.py
2017-12-14 13:04:53 +02:00
Serhiy Storchaka 2e576f5aec bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263) 2017-04-24 09:05:00 +03:00
Serhiy Storchaka 762ec97ea6 bpo-29204: Emit warnings for already deprecated ElementTree features. (#773)
Element.getiterator() and the html parameter of XMLParser() were
deprecated only in the documentation (since Python 3.2 and 3.4 correspondintly).
Now using them emits a deprecation warning.

* Don’t need check_warnings any more.
2017-03-30 18:12:06 +03:00
Raymond Hettinger 11fa3ffcb1 merge 2016-09-11 23:23:24 -07:00
Raymond Hettinger 076366c2a5 Issue #17582: xml.etree.ElementTree nows preserves whitespaces in attributes
(Patch by Duane Griffin.  Reviewed and approved by Stefan Behnel.)
2016-09-11 23:18:03 -07:00
R David Murray 44b548dda8 #27364: fix "incorrect" uses of escape character in the stdlib.
And most of the tools.

Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
2016-09-08 13:59:53 -04:00
Martin Panter 32eeb56f42 Merge Element Tree doc string from 3.5 2016-06-04 07:13:38 +00:00
Martin Panter 29ce082c10 Clarify deprecation of ElementTree.XMLParser(html=...) parameter 2016-06-04 07:12:51 +00:00
Martin Panter dcfebb32e2 Issue #26676: Add missing XMLPullParser to ElementTree.__all__ 2016-04-01 06:55:55 +00:00
Serhiy Storchaka 47a9d59d51 Issue #25902: Fixed various refcount issues in ElementTree iteration. 2015-12-21 11:11:12 +02:00
Serhiy Storchaka 66c08d90f6 Issue #25902: Fixed various refcount issues in ElementTree iteration. 2015-12-21 11:09:48 +02:00
Serhiy Storchaka 9ec5e25f26 Issue #25638: Optimized ElementTree.iterparse(); it is now 2x faster.
ElementTree.XMLParser._setevents now accepts any objects with the append
method, not just a list.
2015-12-07 02:31:11 +02:00
Serhiy Storchaka 6f988b5990 Issue #25688: Fixed file leak in ElementTree.iterparse() raising an error. 2015-11-23 15:45:12 +02:00
Serhiy Storchaka e3d4ec4766 Issue #25688: Fixed file leak in ElementTree.iterparse() raising an error. 2015-11-23 15:44:03 +02:00
Martin Panter 982a08f8bb Issue #25047: Merge Element Tree encoding from 3.4 into 3.5 2015-09-23 01:43:08 +00:00
Martin Panter 89f76d3f91 Issue #25047: Respect case writing XML encoding declarations
This restores the ability to write encoding names in uppercase like "UTF-8",
which worked in Python 2.
2015-09-23 01:14:35 +00:00
Serhiy Storchaka 08448a1f4d Issue #23326: Removed __ne__ implementations. Since fixing default __ne__
implementation in issue #21408 they are redundant.
2015-01-31 12:05:05 +02:00
Serhiy Storchaka 83000a490a Removed duplicated words in in comments and docs. 2014-12-01 18:30:14 +02:00
Serhiy Storchaka 56a6d855e2 Removed duplicated words in in comments and docs. 2014-12-01 18:28:43 +02:00
Serhiy Storchaka 465e60e654 Issue #22033: Reprs of most Python implemened classes now contain actual
class name instead of hardcoded one.
2014-07-25 23:36:00 +03:00
R David Murray 410d320703 whatsnew: XMLPullParser, plus some doc updates.
I was confused by the text saying that read_events "iterated", since it
actually returns an iterator (that's what a generator does) that the
caller must then iterate.  So I tidied up the language.  I'm not sure
what the sentence "Events provided in a previous call to read_events()
will not be yielded again." is trying to convey, so I didn't try to fix that.

Also fixed a couple more news items.
2014-01-04 23:52:50 -05:00
Nick Coghlan 4cc2afa0ec Close #18990: remove root attribute from XMLPullParser
- this was an internal implementation detail for iterparse
- this has been changed to use a new private method instead
- XMLPullParser.close docs are now more explicit about not
  returning a root element and instead direct users towards
  read_events
- also added missing docstrings and clarified some details
  related to exactly *when* events are consumed from the
  internal queue

(Initial patch by Stefan Behnel)
2013-09-28 23:50:35 +10:00
Eli Bendersky b586934f0e Issue #17741: Rename IncrementalParser and its methods.
The new names are hopefully more descriptive and consistent. If you feel you
don't agree with this change, *please* read issue 17741 first - there's a lot of
discussion in there.
2013-08-30 05:51:20 -07:00
Eli Bendersky 6206a7e4b0 Remove the obsolete XMLParser._start/_start_list duality.
XMLParser configures expat to report attributes in a list (ordered_attributes),
so only _start_list is needed. Rename it to _start and kill _start.
2013-08-25 18:58:18 -07:00
Antoine Pitrou 0acbcb5bbe Issue #17741: use composition, rather than inheritance, for xml.etree.iterparse's result class.
Patch by Stefan Behnel.
2013-08-23 23:04:30 +02:00
Ezio Melotti e0c69161bc #18741: merge with 3.3. 2013-08-17 16:13:22 +03:00
Ezio Melotti b5bc353b88 #18741: fix more typos. Patch by Févry Thibault. 2013-08-17 16:11:40 +03:00
Christian Heimes 6597aa16b6 Issue #18347: ElementTree's html serializer now preserves the case of closing tags. 2013-07-05 01:40:52 +02:00
Christian Heimes 54ad7e39df Issue #18347: ElementTree's html serializer now preserves the case of closing tags. 2013-07-05 01:39:49 +02:00
Brett Cannon cd171c8e92 Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a) 2013-07-04 17:43:24 -04:00
Brett Cannon 0a140668fa Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
2013-06-13 20:57:26 -04:00
Eli Bendersky a369923cab Get rid of ugly code duplication for ElementTree.parse when the accelerator
is imported. Instead, ElementTree.parse can look for a special internal method
defined by the accelerator.
2013-05-19 18:47:23 -07:00
Eli Bendersky 8687245e27 normalize whitespace 2013-05-19 09:27:13 -07:00
Eli Bendersky e6a951b83e Cleanup even more dead code 2013-05-19 09:25:52 -07:00
Eli Bendersky c4e98a6a9b Cleanup more old ET library leftovers 2013-05-19 09:24:43 -07:00
Eli Bendersky 46955b2d30 Issue #17988: remove unused alias for Element and rename the used one
Renaming to _Element_Py for clarity and moving it to a more logical location.
_ElementInterface OTOH is unused and is therefore removed.

Close #17988
2013-05-19 09:20:50 -07:00
Eli Bendersky 3a4fbd8241 _elementtree.XMLParser._setevents should support any sequence, not just tuples
Also clean up some code around this
2013-05-19 09:01:49 -07:00
Eli Bendersky c9f5ca232a Remove superfluous try/except 2013-04-20 09:11:37 -07:00
Eli Bendersky bf05df2396 Make license notices more consistent and remove old changelog.
Also remove unused macro.
2013-04-20 05:44:01 -07:00
Antoine Pitrou 5b235d0923 Issue #17741: Add ElementTree.IncrementalParser, an event-driven parser for non-blocking applications. 2013-04-18 19:37:06 +02:00
Victor Stinner 765531d2d0 Issue #17516: use comment syntax for comments, instead of multiline string 2013-03-26 01:11:54 +01:00
Eli Bendersky 72cdb5c39e Issue #11367: fix documentation of some find* methods in ElementTree 2013-03-12 06:04:33 -07:00
Eli Bendersky 7343cb0790 Issue #11367: fix documentation of some find* methods in ElementTree 2013-03-12 06:01:22 -07:00
Eli Bendersky 84fae785ce Issue #16954: Add docstrings for ElementTree
Based on patch by David Lam
2013-03-09 07:12:48 -08:00
Eli Bendersky c4d5e08e3f Issue #9708: Fix support for iterparse(parser=...) argument per documentation.
When _elementtree is imported, iterparse is redefined as a class and the parser
argument was ommitted. Fix this, and add a docstring to the class.
2013-01-24 07:15:46 -08:00
Eli Bendersky aaa9780fe1 Issue #9708: Fix support for iterparse(parser=...) argument per documentation.
When _elementtree is imported, iterparse is redefined as a class and the parser
argument was ommitted. Fix this, and add a docstring to the class.
2013-01-24 07:15:19 -08:00