Skip to content

Commit 401919a

Browse files
authored
Merge branch '3.12' into 3.12_branch_protections
2 parents f8f9726 + 2dd5ce8 commit 401919a

41 files changed

Lines changed: 349 additions & 97 deletions

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,16 @@ jobs:
224224
strategy:
225225
fail-fast: false
226226
matrix:
227-
# macos-26 is Apple Silicon, macos-15-intel is Intel.
228-
# macos-15-intel only runs tests against the GIL-enabled CPython.
227+
# macos-26 is Apple Silicon, macos-26-intel is Intel.
228+
# macos-26-intel only runs tests against the GIL-enabled CPython.
229229
os:
230230
- macos-26
231-
- macos-15-intel
231+
- macos-26-intel
232232
free-threading:
233233
- false
234234
# - true
235235
exclude:
236-
- os: macos-15-intel
236+
- os: macos-26-intel
237237
free-threading: true
238238
uses: ./.github/workflows/reusable-macos.yml
239239
with:

.github/workflows/documentation-links.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ jobs:
2222
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
with:
2424
persist-credentials: false
25-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
26-
with:
27-
python-version: "3.x"
28-
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
25+
- uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1.1.1

.github/workflows/reusable-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
4646
- name: Install Homebrew dependencies
4747
run: |
48-
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8
48+
brew bundle --file=Misc/Brewfile
4949
# Because alternate versions are not symlinked into place by default:
5050
brew link --overwrite tcl-tk@8
5151
- name: Configure CPython

.github/workflows/reusable-tsan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: TSAN option setup
4444
run: |
4545
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/Tools/tsan/suppressions${{
46-
fromJSON(inputs.free-threading)
46+
inputs.free-threading
4747
&& '_free_threading'
4848
|| ''
4949
}}.txt" >> "$GITHUB_ENV"
@@ -63,7 +63,7 @@ jobs:
6363
--config-cache
6464
--with-thread-sanitizer
6565
--with-pydebug
66-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
66+
${{ inputs.free-threading && '--disable-gil' || '' }}
6767
- name: Build CPython
6868
run: make -j4
6969
- name: Display build info

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
--config-cache
8383
--with-pydebug
8484
--with-openssl="$OPENSSL_DIR"
85-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
85+
${{ inputs.free-threading && '--disable-gil' || '' }}
8686
- name: Build CPython out-of-tree
8787
working-directory: ${{ env.CPYTHON_BUILDDIR }}
8888
run: make -j4

.github/workflows/reusable-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
.\\PCbuild\\build.bat
4141
-e -d
4242
-p "${ARCH}"
43-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
43+
${{ inputs.free-threading && '--disable-gil' || '' }}
4444
shell: bash
4545
- name: Display build info
4646
if: inputs.arch != 'arm64'

Doc/library/subprocess.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,12 @@ functions.
630630
the value in ``pw_uid`` will be used. If the value is an integer, it will
631631
be passed verbatim. (POSIX only)
632632

633+
.. note::
634+
635+
Specifying *user* will not drop existing supplementary group memberships!
636+
The caller must also pass ``extra_groups=()`` to reduce the group membership
637+
of the child process for security purposes.
638+
633639
.. availability:: POSIX
634640
.. versionadded:: 3.9
635641

Lib/http/cookies.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,16 @@ def update(self, values):
335335
key = key.lower()
336336
if key not in self._reserved:
337337
raise CookieError("Invalid attribute %r" % (key,))
338+
if _has_control_character(key, val):
339+
raise CookieError("Control characters are not allowed in "
340+
f"cookies {key!r} {val!r}")
338341
data[key] = val
339342
dict.update(self, data)
340343

344+
def __ior__(self, values):
345+
self.update(values)
346+
return self
347+
341348
def isReservedKey(self, K):
342349
return K.lower() in self._reserved
343350

@@ -363,9 +370,15 @@ def __getstate__(self):
363370
}
364371

365372
def __setstate__(self, state):
366-
self._key = state['key']
367-
self._value = state['value']
368-
self._coded_value = state['coded_value']
373+
key = state['key']
374+
value = state['value']
375+
coded_value = state['coded_value']
376+
if _has_control_character(key, value, coded_value):
377+
raise CookieError("Control characters are not allowed in cookies "
378+
f"{key!r} {value!r} {coded_value!r}")
379+
self._key = key
380+
self._value = value
381+
self._coded_value = coded_value
369382

370383
def output(self, attrs=None, header="Set-Cookie:"):
371384
return "%s %s" % (header, self.OutputString(attrs))
@@ -377,13 +390,16 @@ def __repr__(self):
377390

378391
def js_output(self, attrs=None):
379392
# Print javascript
393+
output_string = self.OutputString(attrs)
394+
if _has_control_character(output_string):
395+
raise CookieError("Control characters are not allowed in cookies")
380396
return """
381397
<script type="text/javascript">
382398
<!-- begin hiding
383399
document.cookie = \"%s\";
384400
// end hiding -->
385401
</script>
386-
""" % (self.OutputString(attrs).replace('"', r'\"'))
402+
""" % (output_string.replace('"', r'\"'))
387403

388404
def OutputString(self, attrs=None):
389405
# Build up our result

Lib/importlib/_bootstrap_external.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ def get_filename(self, fullname):
11861186

11871187
def get_data(self, path):
11881188
"""Return the data from path as raw bytes."""
1189-
if isinstance(self, (SourceLoader, ExtensionFileLoader)):
1189+
if isinstance(self, (SourceLoader, SourcelessFileLoader, ExtensionFileLoader)):
11901190
with _io.open_code(str(path)) as file:
11911191
return file.read()
11921192
else:

0 commit comments

Comments
 (0)