This affects string formatting as well as bytes and bytearray formatting.
* For errors in the format string, always include the position of the
start of the format unit.
* For errors related to the formatted arguments, always include the number
or the name of the formatted argument.
* Suggest more probable causes of errors in the format string (stray %,
unsupported format, unexpected character).
* Provide more information when the number of arguments does not match
the number of format units.
* Raise more specific errors when access of arguments by name is mixed with
sequential access and when * is used with a mapping.
* Add tests for some uncovered cases.
Instead of long and uninteresting output for all checked libraries, only print found issues by default.
Add a new -v/--verbose option to list all symbols (useful for checking that the script finds the symbols).
In 3.11 ResourceReader, Traversable, & TraversableResources moved from importlib.abc to importlib.resources.abc (commit e712a5b277866a71c195f38c1b5d87d9126dba3e).
In 3.12 old import locations were deprecated (commit 71848c960927af801656026203371c41ad139b5a).
In 3.14 backwards-compat support was removed (commit 0751511d24295c39fdf2f5b2255e3fa3d796ce4d).
Co-authored-by: Brett Cannon <brett@python.org>
Optimize bytes.translate() by deferring change detection
Move the equality check out of the hot loop to allow better compiler
optimization. Instead of checking each byte during translation, perform
a single memcmp at the end to determine if the input can be returned
unchanged.
This allows compilers to unroll and pipeline the loops, resulting in ~2x
throughput improvement for medium-to-large inputs (tested on an AMD zen2).
No change observed on small inputs.
It will also be faster for bytes subclasses as those do not need change
detection.
Changes in the urllib.parse module:
* Add option missing_as_none in urlparse(), urlsplit() and urldefrag(). If
it is true, represent not defined components as None instead of an
empty string.
* Add option keep_empty in urlunparse() and urlunsplit(). If it is
true, keep empty non-None components in the resulting string.
* Halve size of buffers by reusing combined trace + optimizer buffers for TOS caching
* Add simple buffer struct for more maintainable handling of buffers
* Decouple JIT structs from thread state struct
* Ensure terminator is added to trace, when optimizer gives up
Although PEP 768 mentions how to disable the mechanism of
remote debugging, it is not documented in the Python docs.
This change adds a note on how to disable remote debugging support
in a Python interpreter to the remote debugging how-to.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Along the way, leave a deprecated Tools/wasm/wasi/__main__.py behind for backwards-compatibility.
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
Emit a warning in base64.urlsafe_b64decode() and base64.b64decode() when
the "+" or "/" characters occur in the Base64 data with alternative
alphabet if they are not the part of the alternative alphabet.
It is a DeprecationWarning in the strict mode (will be error) and
a FutureWarning in non-strict mode (will be ignored).
This reverts gh-144055 and fixes the bug in a different way. Deferred
reference counting relies on the object being tracked by the GC,
otherwise the object will live until interpreter shutdown. So, take
care that we do not enable deferred reference counting for objects that
are untracked. Also, if a tuple has deferred reference counting
enabled, don't untrack it.