Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf399c6

Browse files
committed
Merge branch 'main' into dis-instruction
2 parents d0339ab + c932f72 commit bf399c6

583 files changed

Lines changed: 31369 additions & 35220 deletions

File tree

Some content is hidden

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

.azure-pipelines/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(build.sourceBranchName)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1t
60+
openssl_version: 1.1.1u
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1t
86+
openssl_version: 1.1.1u
8787

8888
steps:
8989
- template: ./posix-steps.yml

.azure-pipelines/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1t
60+
openssl_version: 1.1.1u
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1t
86+
openssl_version: 1.1.1u
8787

8888
steps:
8989
- template: ./posix-steps.yml

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ FROM docker.io/library/fedora:37
22

33
ENV CC=clang
44

5-
ENV WASI_SDK_VERSION=19
5+
ENV WASI_SDK_VERSION=20
66
ENV WASI_SDK_PATH=/opt/wasi-sdk
77

88
ENV WASMTIME_HOME=/opt/wasmtime
9-
ENV WASMTIME_VERSION=7.0.0
9+
ENV WASMTIME_VERSION=9.0.1
1010
ENV WASMTIME_CPU_ARCH=x86_64
1111

1212
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \

.devcontainer/devcontainer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"-y",
1010
"which",
1111
"zsh",
12-
"fish"
12+
"fish",
13+
// For umask fix below.
14+
"/usr/bin/setfacl"
1315
],
1416
"updateContentCommand": {
1517
// Using the shell for `nproc` usage.
@@ -22,6 +24,11 @@
2224
"html"
2325
]
2426
},
27+
"postCreateCommand": {
28+
// https://github.com/orgs/community/discussions/26026
29+
"umask fix: workspace": ["sudo", "setfacl", "-bnR", "."],
30+
"umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"]
31+
},
2532
"customizations": {
2633
"vscode": {
2734
"extensions": [
@@ -31,10 +38,10 @@
3138
"maelvalais.autoconf",
3239
// C auto-complete.
3340
"ms-vscode.cpptools",
34-
// To view built docs.
35-
"ms-vscode.live-server"
36-
// https://github.com/microsoft/vscode-python/issues/18073
37-
// "ms-python.python"
41+
// To view HTML build of docs.
42+
"ms-vscode.live-server",
43+
// Python auto-complete.
44+
"ms-python.python"
3845
],
3946
"settings": {
4047
"C_Cpp.default.compilerPath": "/usr/bin/clang",

.github/CODEOWNERS

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Python/traceback.c @iritkatriel
6868
/Tools/build/parse_html5_entities.py @ezio-melotti
6969

7070
# Import (including importlib).
71-
**/*import* @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
71+
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
7272
**/*importlib/resources/* @jaraco @warsaw @FFY00
7373
**/importlib/metadata/* @jaraco @warsaw
7474

@@ -118,6 +118,12 @@ Lib/ast.py @isidentical
118118
/Lib/test/test_subprocess.py @gpshead
119119
/Modules/*subprocess* @gpshead
120120

121+
# Limited C API & stable ABI
122+
Tools/build/stable_abi.py @encukou
123+
Misc/stable_abi.toml @encukou
124+
Doc/data/*.abi @encukou
125+
Doc/c-api/stable.rst @encukou
126+
121127
# Windows
122128
/PC/ @python/windows-team
123129
/PCbuild/ @python/windows-team

.github/workflows/build.yml

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ permissions:
2828
contents: read
2929

3030
concurrency:
31-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
31+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
3232
cancel-in-progress: true
3333

3434
jobs:
@@ -37,8 +37,10 @@ jobs:
3737
runs-on: ubuntu-latest
3838
timeout-minutes: 10
3939
outputs:
40+
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
4041
run_tests: ${{ steps.check.outputs.run_tests }}
4142
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }}
43+
config_hash: ${{ steps.config_hash.outputs.hash }}
4244
steps:
4345
- uses: actions/checkout@v3
4446
- name: Check for source changes
@@ -74,6 +76,45 @@ jobs:
7476
echo "Run hypothesis tests"
7577
echo "run_hypothesis=true" >> $GITHUB_OUTPUT
7678
fi
79+
- name: Compute hash for config cache key
80+
id: config_hash
81+
run: |
82+
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT
83+
- name: Get a list of the changed documentation-related files
84+
if: github.event_name == 'pull_request'
85+
id: changed-docs-files
86+
uses: Ana06/[email protected]
87+
with:
88+
filter: |
89+
Doc/**
90+
# Temporarily skip paths with spaces
91+
# (i.e. "C API", "Core and Builtins")
92+
# to avoid "Error: One of your files includes a space".
93+
# Pending https://github.com/python/core-workflow/issues/186
94+
# Misc/**
95+
Misc/NEWS.d/next/Build/**
96+
Misc/NEWS.d/next/Documentation/**
97+
Misc/NEWS.d/next/IDLE/**
98+
Misc/NEWS.d/next/Library/**
99+
Misc/NEWS.d/next/Security/**
100+
Misc/NEWS.d/next/Tests/**
101+
Misc/NEWS.d/next/Tools-Demos/**
102+
Misc/NEWS.d/next/Windows/**
103+
Misc/NEWS.d/next/macOS/**
104+
.github/workflows/reusable-docs.yml
105+
- name: Check for docs changes
106+
if: >-
107+
github.event_name == 'pull_request'
108+
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
109+
id: docs-changes
110+
run: |
111+
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
112+
113+
check-docs:
114+
name: Docs
115+
needs: check_source
116+
if: fromJSON(needs.check_source.outputs.run-docs)
117+
uses: ./.github/workflows/reusable-docs.yml
77118

78119
check_generated_files:
79120
name: 'Check if generated files are up to date'
@@ -87,18 +128,18 @@ jobs:
87128
uses: actions/cache@v3
88129
with:
89130
path: config.cache
90-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
131+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
91132
- uses: actions/setup-python@v3
92133
- name: Install Dependencies
93134
run: sudo ./.github/workflows/posix-deps-apt.sh
94135
- name: Add ccache to PATH
95136
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
96137
- name: Configure ccache action
97138
uses: hendrikmuhs/[email protected]
98-
- name: Check Autoconf version 2.69 and aclocal 1.16.3
139+
- name: Check Autoconf and aclocal versions
99140
run: |
100-
grep "Generated by GNU Autoconf 2.69" configure
101-
grep "aclocal 1.16.3" aclocal.m4
141+
grep "Generated by GNU Autoconf 2.71" configure
142+
grep "aclocal 1.16.4" aclocal.m4
102143
grep -q "runstatedir" configure
103144
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
104145
- name: Configure CPython
@@ -189,14 +230,13 @@ jobs:
189230
uses: actions/cache@v3
190231
with:
191232
path: config.cache
192-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
233+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
193234
- name: Install Homebrew dependencies
194235
run: brew install pkg-config [email protected] xz gdbm tcl-tk
195236
- name: Configure CPython
196237
run: |
197-
CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
198-
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
199-
PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
238+
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
239+
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
200240
./configure \
201241
--config-cache \
202242
--with-pydebug \
@@ -216,7 +256,7 @@ jobs:
216256
needs: check_source
217257
if: needs.check_source.outputs.run_tests == 'true'
218258
env:
219-
OPENSSL_VER: 1.1.1t
259+
OPENSSL_VER: 1.1.1u
220260
PYTHONSTRICTEXTENSIONBUILD: 1
221261
steps:
222262
- uses: actions/checkout@v3
@@ -255,7 +295,7 @@ jobs:
255295
uses: actions/cache@v3
256296
with:
257297
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
258-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
298+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
259299
- name: Configure CPython out-of-tree
260300
working-directory: ${{ env.CPYTHON_BUILDDIR }}
261301
run: |
@@ -285,7 +325,7 @@ jobs:
285325
strategy:
286326
fail-fast: false
287327
matrix:
288-
openssl_ver: [1.1.1t, 3.0.8, 3.1.0-beta1]
328+
openssl_ver: [1.1.1u, 3.0.9, 3.1.1]
289329
env:
290330
OPENSSL_VER: ${{ matrix.openssl_ver }}
291331
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -297,7 +337,7 @@ jobs:
297337
uses: actions/cache@v3
298338
with:
299339
path: config.cache
300-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
340+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
301341
- name: Register gcc problem matcher
302342
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
303343
- name: Install Dependencies
@@ -337,7 +377,7 @@ jobs:
337377
needs: check_source
338378
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
339379
env:
340-
OPENSSL_VER: 1.1.1t
380+
OPENSSL_VER: 1.1.1u
341381
PYTHONSTRICTEXTENSIONBUILD: 1
342382
steps:
343383
- uses: actions/checkout@v3
@@ -376,7 +416,7 @@ jobs:
376416
uses: actions/cache@v3
377417
with:
378418
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
379-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
419+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
380420
- name: Configure CPython out-of-tree
381421
working-directory: ${{ env.CPYTHON_BUILDDIR }}
382422
run: |
@@ -446,7 +486,7 @@ jobs:
446486
needs: check_source
447487
if: needs.check_source.outputs.run_tests == 'true'
448488
env:
449-
OPENSSL_VER: 1.1.1t
489+
OPENSSL_VER: 1.1.1u
450490
PYTHONSTRICTEXTENSIONBUILD: 1
451491
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
452492
steps:
@@ -455,7 +495,7 @@ jobs:
455495
uses: actions/cache@v3
456496
with:
457497
path: config.cache
458-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
498+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
459499
- name: Register gcc problem matcher
460500
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
461501
- name: Install Dependencies
Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,8 @@
11
name: Docs
22

33
on:
4+
workflow_call:
45
workflow_dispatch:
5-
#push:
6-
# branches:
7-
# - 'main'
8-
# - '3.12'
9-
# - '3.11'
10-
# - '3.10'
11-
# - '3.9'
12-
# - '3.8'
13-
# - '3.7'
14-
# paths:
15-
# - 'Doc/**'
16-
pull_request:
17-
branches:
18-
- 'main'
19-
- '3.12'
20-
- '3.11'
21-
- '3.10'
22-
- '3.9'
23-
- '3.8'
24-
- '3.7'
25-
paths:
26-
- 'Doc/**'
27-
- 'Misc/**'
28-
- '.github/workflows/doc.yml'
296

307
permissions:
318
contents: read

Doc/c-api/abstract.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ but whose items have not been set to some non-\ ``NULL`` value yet.
2424
mapping.rst
2525
iter.rst
2626
buffer.rst
27-
objbuffer.rst

Doc/c-api/arg.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ unit; the entry in (round) parentheses is the Python object type that matches
2727
the format unit; and the entry in [square] brackets is the type of the C
2828
variable(s) whose address should be passed.
2929

30+
.. _arg-parsing-string-and-buffers:
31+
3032
Strings and buffers
3133
-------------------
3234

35+
.. note::
36+
37+
On Python 3.12 and older, the macro :c:macro:`!PY_SSIZE_T_CLEAN` must be
38+
defined before including :file:`Python.h` to use all ``#`` variants of
39+
formats (``s#``, ``y#``, etc.) explained below.
40+
This is not necessary on Python 3.13 and later.
41+
3342
These formats allow accessing an object as a contiguous chunk of memory.
3443
You don't have to provide raw storage for the returned unicode or bytes
3544
area.
@@ -68,15 +77,6 @@ There are three ways strings and buffers can be converted to C:
6877
whether the input object is immutable (e.g. whether it would honor a request
6978
for a writable buffer, or whether another thread can mutate the data).
7079

71-
.. note::
72-
73-
For all ``#`` variants of formats (``s#``, ``y#``, etc.), the macro
74-
:c:macro:`PY_SSIZE_T_CLEAN` must be defined before including
75-
:file:`Python.h`. On Python 3.9 and older, the type of the length argument
76-
is :c:type:`Py_ssize_t` if the :c:macro:`PY_SSIZE_T_CLEAN` macro is defined,
77-
or int otherwise.
78-
79-
8080
``s`` (:class:`str`) [const char \*]
8181
Convert a Unicode object to a C pointer to a character string.
8282
A pointer to an existing string is stored in the character pointer

0 commit comments

Comments
 (0)