Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into pythongh-111968
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Jan 5, 2024
2 parents af86a20 + d99d871 commit 4e84130
Show file tree
Hide file tree
Showing 139 changed files with 3,723 additions and 3,067 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
if: needs.check_source.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Restore config.cache
Expand Down Expand Up @@ -187,13 +187,13 @@ jobs:
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-windows.yml

build_windows_free_threaded:
name: 'Windows (free-threaded)'
build_windows_free_threading:
name: 'Windows (free-threading)'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-windows.yml
with:
free-threaded: true
free-threading: true

build_macos:
name: 'macOS'
Expand All @@ -203,14 +203,14 @@ jobs:
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}

build_macos_free_threaded:
name: 'macOS (free-threaded)'
build_macos_free_threading:
name: 'macOS (free-threading)'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
free-threaded: true
free-threading: true

build_ubuntu:
name: 'Ubuntu'
Expand All @@ -225,8 +225,8 @@ jobs:
--with-pydebug \
--with-openssl=$OPENSSL_DIR
build_ubuntu_free_threaded:
name: 'Ubuntu (free-threaded)'
build_ubuntu_free_threading:
name: 'Ubuntu (free-threading)'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-ubuntu.yml
Expand Down Expand Up @@ -395,7 +395,7 @@ jobs:
-x test_subprocess \
-x test_signal \
-x test_sysconfig
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: hypothesis-example-db
Expand Down Expand Up @@ -483,14 +483,14 @@ jobs:
output-sarif: true
sanitizer: ${{ matrix.sanitizer }}
- name: Upload crash
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success'
with:
name: ${{ matrix.sanitizer }}-artifacts
path: ./out/artifacts
- name: Upload SARIF
if: always() && steps.build.outcome == 'success'
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: cifuzz-sarif/results.sarif
checkout_path: cifuzz-sarif
Expand All @@ -504,12 +504,12 @@ jobs:
- check-docs
- check_generated_files
- build_macos
- build_macos_free_threaded
- build_macos_free_threading
- build_ubuntu
- build_ubuntu_free_threaded
- build_ubuntu_free_threading
- build_ubuntu_ssltests
- build_windows
- build_windows_free_threaded
- build_windows_free_threading
- test_hypothesis
- build_asan
- cifuzz
Expand Down Expand Up @@ -537,12 +537,12 @@ jobs:
&& '
check_generated_files,
build_macos,
build_macos_free_threaded,
build_macos_free_threading,
build_ubuntu,
build_ubuntu_free_threaded,
build_ubuntu_free_threading,
build_ubuntu_ssltests,
build_windows,
build_windows_free_threaded,
build_windows_free_threading,
build_asan,
'
|| ''
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
git fetch origin ${{ env.refspec_base }} --shallow-since="${DATE}" \
--no-tags --prune --no-recurse-submodules
- name: 'Set up Python'
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3'
cache: 'pip'
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: 'Set up Python'
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11' # known to work with Sphinx 4.2
cache: 'pip'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
config_hash:
required: true
type: string
free-threaded:
free-threading:
required: false
type: boolean
default: false
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
./configure \
--config-cache \
--with-pydebug \
${{ inputs.free-threaded && '--disable-gil' || '' }} \
${{ inputs.free-threading && '--disable-gil' || '' }} \
--prefix=/opt/python-dev \
--with-openssl="$(brew --prefix [email protected])"
- name: Build CPython
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/reusable-windows.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
workflow_call:
inputs:
free-threaded:
free-threading:
required: false
type: boolean
default: false
Expand All @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build CPython
run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threading && '--disable-gil' || '' }}
- name: Display build info
run: .\python.bat -m test.pythoninfo
- name: Tests
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Register MSVC problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Build CPython
run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threading && '--disable-gil' || '' }}
- name: Display build info
run: .\python.bat -m test.pythoninfo
- name: Tests
Expand All @@ -50,4 +50,4 @@ jobs:
- name: Register MSVC problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Build CPython
run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threading && '--disable-gil' || '' }}
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: "Check PRs"
uses: actions/stale@v8
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-ensurepip-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3'
- name: Compare checksum of bundled wheels to the ones published on PyPI
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ Querying the error indicator
.. c:function:: PyObject *PyErr_GetRaisedException(void)
Return the exception currently being raised, clearing the error indicator at
the same time.
the same time. Return ``NULL`` if the error indicator is not set.
This function is used by code that needs to catch exceptions,
or code that needs to save and restore the error indicator temporarily.
Expand Down
7 changes: 7 additions & 0 deletions Doc/data/refcounts.dat
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,13 @@ PyObject_Call:PyObject*:callable_object:0:
PyObject_Call:PyObject*:args:0:
PyObject_Call:PyObject*:kw:0:

PyObject_CallNoArgs:PyObject*::+1:
PyObject_CallNoArgs:PyObject*:callable_object:0:

PyObject_CallOneArg:PyObject*::+1:
PyObject_CallOneArg:PyObject*:callable_object:0:
PyObject_CallOneArg:PyObject*:arg:0:

PyObject_CallFunction:PyObject*::+1:
PyObject_CallFunction:PyObject*:callable_object:0:
PyObject_CallFunction:const char*:format::
Expand Down
32 changes: 16 additions & 16 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ converters and customize the provided ones. [1]_
Fallback Values
---------------

As with a dictionary, you can use a section's :meth:`get` method to
As with a dictionary, you can use a section's :meth:`~ConfigParser.get` method to
provide fallback values:

.. doctest::
Expand All @@ -232,7 +232,7 @@ even if we specify a fallback:
>>> topsecret.get('CompressionLevel', '3')
'9'

One more thing to be aware of is that the parser-level :meth:`get` method
One more thing to be aware of is that the parser-level :meth:`~ConfigParser.get` method
provides a custom, more complex interface, maintained for backwards
compatibility. When using this method, a fallback value can be provided via
the ``fallback`` keyword-only argument:
Expand Down Expand Up @@ -271,7 +271,7 @@ out. Values can also span multiple lines, as long as they are indented deeper
than the first line of the value. Depending on the parser's mode, blank lines
may be treated as parts of multiline values or ignored.

By default, a valid section name can be any string that does not contain '\\n' or ']'.
By default, a valid section name can be any string that does not contain '\\n'.
To change this, see :attr:`ConfigParser.SECTCRE`.

Configuration files may include comments, prefixed by specific
Expand Down Expand Up @@ -481,7 +481,7 @@ historical background and it's very likely that you will want to customize some
of the features.

The most common way to change the way a specific config parser works is to use
the :meth:`__init__` options:
the :meth:`!__init__` options:

* *defaults*, default value: ``None``

Expand All @@ -491,7 +491,7 @@ the :meth:`__init__` options:
the documented default.

Hint: if you want to specify default values for a specific section, use
:meth:`read_dict` before you read the actual file.
:meth:`~ConfigParser.read_dict` before you read the actual file.

* *dict_type*, default value: :class:`dict`

Expand Down Expand Up @@ -635,8 +635,8 @@ the :meth:`__init__` options:
* *strict*, default value: ``True``

When set to ``True``, the parser will not allow for any section or option
duplicates while reading from a single source (using :meth:`read_file`,
:meth:`read_string` or :meth:`read_dict`). It is recommended to use strict
duplicates while reading from a single source (using :meth:`~ConfigParser.read_file`,
:meth:`~ConfigParser.read_string` or :meth:`~ConfigParser.read_dict`). It is recommended to use strict
parsers in new applications.

.. versionchanged:: 3.2
Expand Down Expand Up @@ -697,7 +697,7 @@ the :meth:`__init__` options:
desirable, users may define them in a subclass or pass a dictionary where each
key is a name of the converter and each value is a callable implementing said
conversion. For instance, passing ``{'decimal': decimal.Decimal}`` would add
:meth:`getdecimal` on both the parser object and all section proxies. In
:meth:`!getdecimal` on both the parser object and all section proxies. In
other words, it will be possible to write both
``parser_instance.getdecimal('section', 'key', fallback=0)`` and
``parser_instance['section'].getdecimal('key', 0)``.
Expand Down Expand Up @@ -1062,11 +1062,11 @@ ConfigParser Objects
yielding Unicode strings (for example files opened in text mode).

Optional argument *source* specifies the name of the file being read. If
not given and *f* has a :attr:`name` attribute, that is used for
not given and *f* has a :attr:`!name` attribute, that is used for
*source*; the default is ``'<???>'``.

.. versionadded:: 3.2
Replaces :meth:`readfp`.
Replaces :meth:`!readfp`.

.. method:: read_string(string, source='<string>')

Expand Down Expand Up @@ -1214,7 +1214,7 @@ ConfigParser Objects

.. data:: MAX_INTERPOLATION_DEPTH

The maximum depth for recursive interpolation for :meth:`get` when the *raw*
The maximum depth for recursive interpolation for :meth:`~configparser.ConfigParser.get` when the *raw*
parameter is false. This is relevant only when the default *interpolation*
is used.

Expand Down Expand Up @@ -1287,13 +1287,13 @@ Exceptions

.. exception:: DuplicateSectionError

Exception raised if :meth:`add_section` is called with the name of a section
Exception raised if :meth:`~ConfigParser.add_section` is called with the name of a section
that is already present or in strict parsers when a section if found more
than once in a single input file, string or dictionary.

.. versionadded:: 3.2
Optional ``source`` and ``lineno`` attributes and arguments to
:meth:`__init__` were added.
:meth:`!__init__` were added.


.. exception:: DuplicateOptionError
Expand Down Expand Up @@ -1345,9 +1345,9 @@ Exceptions

Exception raised when errors occur attempting to parse a file.

.. versionchanged:: 3.12
The ``filename`` attribute and :meth:`__init__` constructor argument were
removed. They have been available using the name ``source`` since 3.2.
.. versionchanged:: 3.12
The ``filename`` attribute and :meth:`!__init__` constructor argument were
removed. They have been available using the name ``source`` since 3.2.

.. rubric:: Footnotes

Expand Down
9 changes: 5 additions & 4 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,18 @@ operation is being performed, so the intermediate analysis object isn't useful:

.. function:: findlinestarts(code)

This generator function uses the ``co_lines`` method
of the code object *code* to find the offsets which are starts of
This generator function uses the :meth:`~codeobject.co_lines` method
of the :ref:`code object <code-objects>` *code* to find the offsets which
are starts of
lines in the source code. They are generated as ``(offset, lineno)`` pairs.

.. versionchanged:: 3.6
Line numbers can be decreasing. Before, they were always increasing.

.. versionchanged:: 3.10
The :pep:`626` ``co_lines`` method is used instead of the
The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the
:attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab`
attributes of the code object.
attributes of the :ref:`code object <code-objects>`.

.. versionchanged:: 3.13
Line numbers can be ``None`` for bytecode that does not map to source lines.
Expand Down
Loading

0 comments on commit 4e84130

Please sign in to comment.