Skip to content

Commit 33714ad

Browse files
committed
Merge branch 'main' into fix-issue-138774
2 parents 98e155b + aa9d0a6 commit 33714ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1593
-773
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"image": "ghcr.io/python/wasicontainer:latest",
3+
"onCreateCommand": [
4+
// Install common tooling.
5+
"dnf",
6+
"install",
7+
"-y",
8+
// For umask fix below.
9+
"/usr/bin/setfacl"
10+
],
11+
"updateContentCommand": {
12+
// Using the shell for `nproc` usage.
13+
"python": "python3 Tools/wasm/wasi build --quiet -- --with-pydebug -C"
14+
},
15+
"postCreateCommand": {
16+
// https://github.com/orgs/community/discussions/26026
17+
"umask fix: workspace": ["sudo", "setfacl", "-bnR", "."],
18+
"umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"]
19+
},
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
// Highlighting for Parser/Python.asdl.
24+
"brettcannon.zephyr-asdl",
25+
// Highlighting for configure.ac.
26+
"maelvalais.autoconf",
27+
// C auto-complete.
28+
"ms-vscode.cpptools",
29+
// Python auto-complete.
30+
"ms-python.python"
31+
],
32+
"settings": {
33+
"C_Cpp.default.compilerPath": "/usr/bin/clang",
34+
"C_Cpp.default.cStandard": "c11",
35+
"C_Cpp.default.defines": [
36+
"CONFIG_64",
37+
"Py_BUILD_CORE"
38+
],
39+
"C_Cpp.default.includePath": [
40+
"${workspaceFolder}/*",
41+
"${workspaceFolder}/Include/**"
42+
],
43+
// https://github.com/microsoft/vscode-cpptools/issues/10732
44+
"C_Cpp.errorSquiggles": "disabled",
45+
"editor.insertSpaces": true,
46+
"editor.rulers": [
47+
80
48+
],
49+
"editor.tabSize": 4,
50+
"editor.trimAutoWhitespace": true,
51+
"files.associations": {
52+
"*.h": "c"
53+
},
54+
"files.encoding": "utf8",
55+
"files.eol": "\n",
56+
"files.insertFinalNewline": true,
57+
"files.trimTrailingWhitespace": true,
58+
"python.analysis.diagnosticSeverityOverrides": {
59+
// Complains about shadowing the stdlib w/ the stdlib.
60+
"reportShadowedImports": "none",
61+
// Doesn't like _frozen_importlib.
62+
"reportMissingImports": "none"
63+
},
64+
"python.analysis.extraPaths": [
65+
"Lib"
66+
],
67+
"[restructuredtext]": {
68+
"editor.tabSize": 3
69+
}
70+
}
71+
}
72+
}
73+
}

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
runs-on: ubuntu-24.04
1717
timeout-minutes: 60
1818
env:
19-
WASMTIME_VERSION: 22.0.0
20-
WASI_SDK_VERSION: 24
19+
WASMTIME_VERSION: 38.0.2
20+
WASI_SDK_VERSION: 25
2121
WASI_SDK_PATH: /opt/wasi-sdk
2222
CROSS_BUILD_PYTHON: cross-build/build
2323
CROSS_BUILD_WASI: cross-build/wasm32-wasip1

Doc/faq/general.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ How do I get documentation on Python?
186186
-------------------------------------
187187

188188
The standard documentation for the current stable version of Python is available
189-
at https://docs.python.org/3/. PDF, plain text, and downloadable HTML versions are
189+
at https://docs.python.org/3/. EPUB, plain text, and downloadable HTML versions are
190190
also available at https://docs.python.org/3/download.html.
191191

192192
The documentation is written in reStructuredText and processed by `the Sphinx

Doc/library/annotationlib.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,29 @@ Functions
340340

341341
* VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist,
342342
the :attr:`!object.__annotate__` function is called if it exists.
343+
343344
* FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated successfully,
344345
it is used; otherwise, the :attr:`!object.__annotate__` function is called. If it
345346
does not exist either, :attr:`!object.__annotations__` is tried again and any error
346347
from accessing it is re-raised.
348+
349+
* When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.FORWARDREF`.
350+
If this is not implemented, it will then check if :attr:`~Format.VALUE_WITH_FAKE_GLOBALS`
351+
is supported and use that in the fake globals environment.
352+
If neither of these formats are supported, it will fall back to using :attr:`~Format.VALUE`.
353+
If :attr:`~Format.VALUE` fails, the error from this call will be raised.
354+
347355
* STRING: If :attr:`!object.__annotate__` exists, it is called first;
348356
otherwise, :attr:`!object.__annotations__` is used and stringified
349357
using :func:`annotations_to_string`.
350358

359+
* When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.STRING`.
360+
If this is not implemented, it will then check if :attr:`~Format.VALUE_WITH_FAKE_GLOBALS`
361+
is supported and use that in the fake globals environment.
362+
If neither of these formats are supported, it will fall back to using :attr:`~Format.VALUE`
363+
with the result converted using :func:`annotations_to_string`.
364+
If :attr:`~Format.VALUE` fails, the error from this call will be raised.
365+
351366
Returns a dict. :func:`!get_annotations` returns a new dict every time
352367
it's called; calling it twice on the same object will return two
353368
different but equivalent dicts.

Doc/library/argparse.rst

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ ArgumentParser objects
7474
prefix_chars='-', fromfile_prefix_chars=None, \
7575
argument_default=None, conflict_handler='error', \
7676
add_help=True, allow_abbrev=True, exit_on_error=True, \
77-
*, suggest_on_error=False, color=True)
77+
*, suggest_on_error=True, color=True)
7878
7979
Create a new :class:`ArgumentParser` object. All parameters should be passed
8080
as keyword arguments. Each parameter has its own more detailed description
@@ -117,7 +117,7 @@ ArgumentParser objects
117117
error info when an error occurs. (default: ``True``)
118118

119119
* suggest_on_error_ - Enables suggestions for mistyped argument choices
120-
and subparser names (default: ``False``)
120+
and subparser names (default: ``True``)
121121

122122
* color_ - Allow color output (default: ``True``)
123123

@@ -134,6 +134,9 @@ ArgumentParser objects
134134
.. versionchanged:: 3.14
135135
*suggest_on_error* and *color* parameters were added.
136136

137+
.. versionchanged:: 3.15
138+
*suggest_on_error* default changed to ``True``.
139+
137140
The following sections describe how each of these are used.
138141

139142

@@ -596,13 +599,11 @@ suggest_on_error
596599
^^^^^^^^^^^^^^^^
597600

598601
By default, when a user passes an invalid argument choice or subparser name,
599-
:class:`ArgumentParser` will exit with error info and list the permissible
600-
argument choices (if specified) or subparser names as part of the error message.
601-
602-
If the user would like to enable suggestions for mistyped argument choices and
603-
subparser names, the feature can be enabled by setting ``suggest_on_error`` to
604-
``True``. Note that this only applies for arguments when the choices specified
605-
are strings::
602+
:class:`ArgumentParser` will exit with error info and provide suggestions for
603+
mistyped arguments. The error message will list the permissible argument
604+
choices (if specified) or subparser names, along with a "maybe you meant"
605+
suggestion if a close match is found. Note that this only applies for arguments
606+
when the choices specified are strings::
606607

607608
>>> parser = argparse.ArgumentParser(description='Process some integers.',
608609
suggest_on_error=True)
@@ -612,16 +613,14 @@ are strings::
612613
>>> parser.parse_args(['--action', 'sumn', 1, 2, 3])
613614
tester.py: error: argument --action: invalid choice: 'sumn', maybe you meant 'sum'? (choose from 'sum', 'max')
614615

615-
If you're writing code that needs to be compatible with older Python versions
616-
and want to opportunistically use ``suggest_on_error`` when it's available, you
617-
can set it as an attribute after initializing the parser instead of using the
618-
keyword argument::
616+
You can disable suggestions by setting ``suggest_on_error`` to ``False``::
619617

620-
>>> parser = argparse.ArgumentParser(description='Process some integers.')
621-
>>> parser.suggest_on_error = True
618+
>>> parser = argparse.ArgumentParser(description='Process some integers.',
619+
suggest_on_error=False)
622620

623621
.. versionadded:: 3.14
624-
622+
.. versionchanged:: 3.15
623+
Changed default value of ``suggest_on_error`` from ``False`` to ``True``.
625624

626625
color
627626
^^^^^

0 commit comments

Comments
 (0)