[pull] main from python:main - #1475
Merged
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )