<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Lib/xml, branch main</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>gh-83122: Deprecate testing element truth values in `ElementTree` (#31149)</title>
<updated>2023-01-23T01:16:48+00:00</updated>
<author>
<name>Jacob Walls</name>
<email>jacobtylerwalls@gmail.com</email>
</author>
<published>2023-01-23T01:16:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=d717be04dc7876696cb21ce7901bda0214c4b2e0'/>
<id>d717be04dc7876696cb21ce7901bda0214c4b2e0</id>
<content type='text'>
When testing element truth values, emit a DeprecationWarning in all implementations.

This had emitted a FutureWarning in the rarely used python-only implementation since ~2.7 and has always been documented as a behavior not to rely on.

Matching an element in a tree search but having it test False can be unexpected. Raising the warning enables making the choice to finally raise an exception for this ambiguous behavior in the future.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When testing element truth values, emit a DeprecationWarning in all implementations.

This had emitted a FutureWarning in the rarely used python-only implementation since ~2.7 and has always been documented as a behavior not to rely on.

Matching an element in a tree search but having it test False can be unexpected. Raising the warning enables making the choice to finally raise an exception for this ambiguous behavior in the future.</pre>
</div>
</content>
</entry>
<entry>
<title>gh-99482: remove `jython` compatibility parts from stdlib and tests (#99484)</title>
<updated>2022-12-23T20:17:24+00:00</updated>
<author>
<name>Nikita Sobolev</name>
<email>mail@sobolevn.me</email>
</author>
<published>2022-12-23T20:17:24+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=745545b5bb847023f90505bf9caa983463413780'/>
<id>745545b5bb847023f90505bf9caa983463413780</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-45975: Simplify some while-loops with walrus operator (GH-29347)</title>
<updated>2022-11-26T22:33:25+00:00</updated>
<author>
<name>Nick Drozd</name>
<email>nicholasdrozd@gmail.com</email>
</author>
<published>2022-11-26T22:33:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=024ac542d738f56b36bdeb3517a10e93da5acab9'/>
<id>024ac542d738f56b36bdeb3517a10e93da5acab9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>gh-96175: add missing self._localName assignment in `xml.dom.minidom.Attr` (#96176)</title>
<updated>2022-08-23T16:16:02+00:00</updated>
<author>
<name>Kevin Kirsche</name>
<email>Kev.Kirsche+GitHub@gmail.com</email>
</author>
<published>2022-08-23T16:16:02+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=58f6953d6d3fe20d972bfa2f6e982206adcf1353'/>
<id>58f6953d6d3fe20d972bfa2f6e982206adcf1353</id>
<content type='text'>
X-Ref: https://github.com/python/typeshed/pull/8590#discussion_r951473977

Co-authored-by: Jelle Zijlstra &lt;jelle.zijlstra@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
X-Ref: https://github.com/python/typeshed/pull/8590#discussion_r951473977

Co-authored-by: Jelle Zijlstra &lt;jelle.zijlstra@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>gh-91447: Fix findtext to only give an empty string on None (GH-91486)</title>
<updated>2022-08-01T16:52:39+00:00</updated>
<author>
<name>Eugene Triguba</name>
<email>eugenetriguba@gmail.com</email>
</author>
<published>2022-08-01T16:52:39+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=a95e60db748ec6f2c19b5710c11f62e1e4d669f4'/>
<id>a95e60db748ec6f2c19b5710c11f62e1e4d669f4</id>
<content type='text'>
The API documentation for [findtext](https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.findtext) states that this function gives back an empty string on "no text content." With the previous implementation, this would give back a empty string even on text content values such as 0 or False. This patch attempts to resolve that by only giving back an empty string if the text attribute is set to `None`. Resolves #91447.

Automerge-Triggered-By: GH:gvanrossum</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The API documentation for [findtext](https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.findtext) states that this function gives back an empty string on "no text content." With the previous implementation, this would give back a empty string even on text content values such as 0 or False. This patch attempts to resolve that by only giving back an empty string if the text attribute is set to `None`. Resolves #91447.

Automerge-Triggered-By: GH:gvanrossum</pre>
</div>
</content>
</entry>
<entry>
<title>gh-94383: Remove ElementTree.Element.copy() method (#94384)</title>
<updated>2022-07-04T13:51:01+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2022-07-04T13:51:01+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=fd76eb547dd5d2c8307a89422049b6c3c80541ab'/>
<id>fd76eb547dd5d2c8307a89422049b6c3c80541ab</id>
<content type='text'>
xml.etree: Remove the ElementTree.Element.copy() method of the pure
Python implementation, deprecated in Python 3.10, use the copy.copy()
function instead. The C implementation of xml.etree has no copy()
method, only a __copy__() method.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
xml.etree: Remove the ElementTree.Element.copy() method of the pure
Python implementation, deprecated in Python 3.10, use the copy.copy()
function instead. The C implementation of xml.etree has no copy()
method, only a __copy__() method.</pre>
</div>
</content>
</entry>
<entry>
<title>gh-91810: Fix regression with writing an XML declaration with encoding='unicode' (GH-93426)</title>
<updated>2022-06-14T04:25:33+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2022-06-14T04:25:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=d7db9dc3cc5b44d0b4ce000571fecf58089a01ec'/>
<id>d7db9dc3cc5b44d0b4ce000571fecf58089a01ec</id>
<content type='text'>
Suppress writing an XML declaration in open files in ElementTree.write()
with encoding='unicode' and xml_declaration=None.

If file patch is passed to ElementTree.write() with encoding='unicode',
always open a new file in UTF-8.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Suppress writing an XML declaration in open files in ElementTree.write()
with encoding='unicode' and xml_declaration=None.

If file patch is passed to ElementTree.write() with encoding='unicode',
always open a new file in UTF-8.
</pre>
</div>
</content>
</entry>
<entry>
<title>gh-91810: ElementTree: Use text file's encoding by default in XML declaration (GH-91903)</title>
<updated>2022-05-11T06:31:07+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2022-05-11T06:31:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=707839b0fe02ba2c891a40f40e7a869d84c2c9c5'/>
<id>707839b0fe02ba2c891a40f40e7a869d84c2c9c5</id>
<content type='text'>
ElementTree method write() and function tostring() now use the text file's
encoding ("UTF-8" if not available) instead of locale encoding in XML
declaration when encoding="unicode" is specified.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ElementTree method write() and function tostring() now use the text file's
encoding ("UTF-8" if not available) instead of locale encoding in XML
declaration when encoding="unicode" is specified.
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-43292: Fix file leak in `ET.iterparse()` when not exhausted (GH-31696)</title>
<updated>2022-03-07T09:31:46+00:00</updated>
<author>
<name>Jacob Walls</name>
<email>jacobtylerwalls@gmail.com</email>
</author>
<published>2022-03-07T09:31:46+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=496c428de3318c9c5770937491b71dc3d3f18a6a'/>
<id>496c428de3318c9c5770937491b71dc3d3f18a6a</id>
<content type='text'>
Co-authored-by: Serhiy Storchaka &lt;storchaka@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Serhiy Storchaka &lt;storchaka@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-46786: Make ElementTree write the HTML tags embed, source, track, wbr as empty tags (GH-31406)</title>
<updated>2022-02-27T14:25:54+00:00</updated>
<author>
<name>Jannis Vajen</name>
<email>jvajen@gmail.com</email>
</author>
<published>2022-02-27T14:25:54+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=345572a1a0263076081020524016eae867677cac'/>
<id>345572a1a0263076081020524016eae867677cac</id>
<content type='text'>
See https://html.spec.whatwg.org/multipage/syntax.html#void-elements
for reference.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See https://html.spec.whatwg.org/multipage/syntax.html#void-elements
for reference.</pre>
</div>
</content>
</entry>
</feed>
