Skip to content

[pull] main from python:main - #1475

Merged
pull[bot] merged 14 commits into
tj-python:mainfrom
python:main
Sep 13, 2026
Merged

[pull] main from python:main#1475
pull[bot] merged 14 commits into
tj-python:mainfrom
python:main

Conversation

@pull

@pull pull Bot commented Sep 13, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

vstinner and others added 14 commits September 13, 2026 12:11
Replace soft deprecated PyBytes_FromStringAndSize(NULL, n) with
PyBytes_FromStringAndSize(str, n) so marshal can get bytes singleton.
…6763)

It was said that iterparse() can be useful for reading a large document
without holding it wholly in memory, but the tree is only built
incrementally, it is not freed incrementally.  Document how to remove the
processed elements, and that a custom target does not build a tree at all.
urllib.request.pathname2url() and url2pathname() use the filesystem encoding
and error handler since gh-85168, but nturl2path, which implements them on
Windows before 3.14, was left unchanged.  Paths containing surrogate
characters raised UnicodeEncodeError.
25 tests were defined as "def testX(self): pass" and reported success
without testing anything.
The list of events was collected by the TreeBuilder in the C implementation,
so the pull parser only worked with the standard target.  The parser itself
now collects the events, and reports what the target returns.  XMLPullParser
and iterparse() get the target parameter, which makes it possible to parse a
large document incrementally without building a tree for it.

The namespace events no longer need a separate code path: the parser reports
the prefix and the uri if the target does not implement start_ns()/end_ns(),
as the Python implementation already did.
)

There is a known data race involving PyMem_SetAllocator(). Just skip
tests using _testcapi.set_nomemory() is Python is built with the
thread sanitizer.

Mark test_io.test_memoryio test using _testcapi.set_nomemory()
with @support.nomemtest.
Co-authored-by: Stan Ulbrych <stan@python.org>
Add Modules/_testcapi/marshal.c and
Lib/test/test_capi/test_marshal.py.
…inting (GH-156660)

Pretty-printing added whitespace inside an element which contains text,
which changed its content.  Now xml.dom.minidom.Node.toprettyxml() and
xml.etree.ElementTree.indent() do not add whitespace inside an element
which is marked with xml:space="preserve" or which contains text.
toprettyxml() also takes into account the content model declared in
the DTD: only white space in element content is ignorable.
* Docs: split builtins to their own page from library

* review feedback

* addressed Hugo's feedback

* update the What's Next page

* one more wording tweak

* move builtins to their own directory. fix the reference name

* moved pages need to be noted in tools/removed-ids.txt

* add Python to the builtins reference title

* add sphinxext-rediraffe for the library->builtins split

* update check-html-ids to handle rediraffe redirects

* now we don't need (page missing) for the redirected pages

* update other references to moved pages

* A seealso from builtins to library

* make a nice section for rediraffe settings

* move the builtins note to the end, as a seealso

* address merwok's comments

* cache looking for ids in files

* simplify the intro paragraphs
createElementNS(), createAttributeNS() and setAttributeNS() now raise
NamespaceErr for a malformed qualified name, for a prefix with an empty
namespace, and for illegal use of the "xml" and "xmlns" prefixes, as required
by DOM Level 2 Core.  Setting the prefix of an attribute is validated too.

Two tests used a wrong namespace URI for xmlns attributes.
GH-156747)

Serialization with the default_namespace option failed for any attribute
without a namespace.  But a default namespace declaration does not apply
to attribute names, so an unqualified attribute name is written as is.
For the same reason a qualified attribute name in the default namespace is
now written with a prefix; it was written without one, which lost its
namespace (gh-113581).
…ion (GH-155248)

A parameter can be given an alternative name by declaring a keyword-only
parameter with a default value which shares the C name of a preceding one:

    a: object = None
    *
    b as a: object = None

Only one of the alternative names can be used in a call; passing both is
a TypeError.  An alias is not shown in the signature.

The `[until X.Y]` prefix marks a parameter which will be removed in that
release.  Passing it emits a DeprecationWarning, and the generated code
warns at compile time when that release is reached.  A deprecated
parameter must have a default value, and only the last positional-only
parameters can be deprecated, because removing one would leave no way to
pass those which follow it.
@pull pull Bot locked and limited conversation to collaborators Sep 13, 2026
@pull pull Bot added the ⤵️ pull label Sep 13, 2026
@pull
pull Bot merged commit 01399a3 into tj-python:main Sep 13, 2026
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants