Skip to content

Commit 0650ab2

Browse files
authored
Merge branch 'main' into ast-frozendict
2 parents aeed04a + ba0aca3 commit 0650ab2

6 files changed

Lines changed: 40 additions & 35 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,16 @@ jobs:
206206
strategy:
207207
fail-fast: false
208208
matrix:
209-
# macos-26 is Apple Silicon, macos-15-intel is Intel.
210-
# macos-15-intel only runs tests against the GIL-enabled CPython.
209+
# macos-26 is Apple Silicon, macos-26-intel is Intel.
210+
# macos-26-intel only runs tests against the GIL-enabled CPython.
211211
os:
212212
- macos-26
213-
- macos-15-intel
213+
- macos-26-intel
214214
free-threading:
215215
- false
216216
- true
217217
exclude:
218-
- os: macos-15-intel
218+
- os: macos-26-intel
219219
free-threading: true
220220
uses: ./.github/workflows/reusable-macos.yml
221221
with:

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ jobs:
5454
--prefix=/opt/python-dev \
5555
--with-openssl="$(brew --prefix openssl@3.5)"
5656
- name: Build CPython
57-
if : ${{ inputs.free-threading || inputs.os != 'macos-15-intel' }}
57+
if : ${{ inputs.free-threading || inputs.os != 'macos-26-intel' }}
5858
run: gmake -j8
5959
- name: Build CPython for compiler warning check
60-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
60+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
6161
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
6262
- name: Display build info
6363
run: make pythoninfo
6464
- name: Check compiler warnings
65-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
65+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
6666
run: >-
6767
python3 Tools/build/check_warnings.py
6868
--compiler-output-file-path=compiler_output_macos.txt

Doc/library/shutil.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,8 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
749749

750750
Never extract archives from untrusted sources without prior inspection.
751751
It is possible that files are created outside of the path specified in
752-
the *extract_dir* argument, e.g. members that have absolute filenames
753-
starting with "/" or filenames with two dots "..".
752+
the *extract_dir* argument, for example, members that have absolute filenames
753+
or filenames with ".." components.
754754

755755
Since Python 3.14, the defaults for both built-in formats (zip and tar
756756
files) will prevent the most dangerous of such security issues,

Doc/library/stdtypes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,6 +2747,8 @@ expression support in the :mod:`re` module).
27472747
The *chars* argument is not a prefix or suffix; rather, all combinations of its
27482748
values are stripped.
27492749

2750+
Whitespace characters are defined by :meth:`str.isspace`.
2751+
27502752
For example:
27512753

27522754
.. doctest::

Doc/library/zipfile.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ ZipFile objects
411411
.. warning::
412412

413413
Never extract archives from untrusted sources without prior inspection.
414-
It is possible that files are created outside of *path*, e.g. members
415-
that have absolute filenames starting with ``"/"`` or filenames with two
416-
dots ``".."``. This module attempts to prevent that.
414+
It is possible that files are created outside of *path*, for example, members
415+
that have absolute filenames or filenames with ".." components.
416+
This module attempts to prevent that.
417417
See :meth:`extract` note.
418418

419419
.. versionchanged:: 3.6
@@ -590,7 +590,7 @@ Path objects
590590
The :class:`Path` class does not sanitize filenames within the ZIP archive. Unlike
591591
the :meth:`ZipFile.extract` and :meth:`ZipFile.extractall` methods, it is the
592592
caller's responsibility to validate or sanitize filenames to prevent path traversal
593-
vulnerabilities (e.g., filenames containing ".." or absolute paths). When handling
593+
vulnerabilities (for example, absolute paths or paths with ".." components). When handling
594594
untrusted archives, consider resolving filenames using :func:`os.path.abspath`
595595
and checking against the target directory with :func:`os.path.commonpath`.
596596

Lib/test/test_pathlib/test_pathlib.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,14 +2526,15 @@ def test_mkdir_with_parent_mode(self):
25262526
p = self.cls(self.base, 'newdirPM', 'subdirPM')
25272527
self.assertFalse(p.exists())
25282528
if os.name != 'nt':
2529-
# Specify different modes for parent and leaf directories
2530-
p.mkdir(0o755, parents=True, parent_mode=0o750)
2531-
self.assertTrue(p.exists())
2532-
self.assertTrue(p.is_dir())
2533-
# Leaf directory gets the mode parameter
2534-
self.assertEqual(p.stat().st_mode & 0o777, 0o755)
2535-
# Parent directory gets the parent_mode parameter
2536-
self.assertEqual(p.parent.stat().st_mode & 0o777, 0o750)
2529+
with os_helper.temp_umask(0o022):
2530+
# Specify different modes for parent and leaf directories
2531+
p.mkdir(0o755, parents=True, parent_mode=0o750)
2532+
self.assertTrue(p.exists())
2533+
self.assertTrue(p.is_dir())
2534+
# Leaf directory gets the mode parameter
2535+
self.assertEqual(p.stat().st_mode & 0o777, 0o755)
2536+
# Parent directory gets the parent_mode parameter
2537+
self.assertEqual(p.parent.stat().st_mode & 0o777, 0o750)
25372538

25382539
@unittest.skipIf(
25392540
is_emscripten or is_wasi,
@@ -2548,15 +2549,16 @@ def test_mkdir_parent_mode_deep_hierarchy(self):
25482549
p = self.cls(self.base, 'level1PM', 'level2PM', 'level3PM')
25492550
self.assertFalse(p.exists())
25502551
if os.name != 'nt':
2551-
p.mkdir(0o755, parents=True, parent_mode=0o700)
2552-
self.assertTrue(p.exists())
2553-
# Check that all parent directories have parent_mode
2554-
level1 = self.cls(self.base, 'level1PM')
2555-
level2 = level1 / 'level2PM'
2556-
self.assertEqual(level1.stat().st_mode & 0o777, 0o700)
2557-
self.assertEqual(level2.stat().st_mode & 0o777, 0o700)
2558-
# Leaf directory has the regular mode
2559-
self.assertEqual(p.stat().st_mode & 0o777, 0o755)
2552+
with os_helper.temp_umask(0o022):
2553+
p.mkdir(0o755, parents=True, parent_mode=0o700)
2554+
self.assertTrue(p.exists())
2555+
# Check that all parent directories have parent_mode
2556+
level1 = self.cls(self.base, 'level1PM')
2557+
level2 = level1 / 'level2PM'
2558+
self.assertEqual(level1.stat().st_mode & 0o777, 0o700)
2559+
self.assertEqual(level2.stat().st_mode & 0o777, 0o700)
2560+
# Leaf directory has the regular mode
2561+
self.assertEqual(p.stat().st_mode & 0o777, 0o755)
25602562

25612563
@unittest.skipIf(
25622564
is_emscripten or is_wasi,
@@ -2593,11 +2595,12 @@ def test_mkdir_parent_mode_same_as_mode(self):
25932595
p = self.cls(self.base, 'samedirPM', 'subdirPM')
25942596
self.assertFalse(p.exists())
25952597
if os.name != 'nt':
2596-
p.mkdir(0o705, parents=True, parent_mode=0o705)
2597-
self.assertTrue(p.exists())
2598-
# Both directories should have the same mode
2599-
self.assertEqual(p.stat().st_mode & 0o777, 0o705)
2600-
self.assertEqual(p.parent.stat().st_mode & 0o777, 0o705)
2598+
with os_helper.temp_umask(0o022):
2599+
p.mkdir(0o705, parents=True, parent_mode=0o705)
2600+
self.assertTrue(p.exists())
2601+
# Both directories should have the same mode
2602+
self.assertEqual(p.stat().st_mode & 0o777, 0o705)
2603+
self.assertEqual(p.parent.stat().st_mode & 0o777, 0o705)
26012604

26022605
@needs_symlinks
26032606
def test_symlink_to(self):

0 commit comments

Comments
 (0)