Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8f2341c

Browse filesBrowse files
Merge branch '3.8' into backport-77e0919-3.8
2 parents fa448f4 + 648c44d commit 8f2341c
Copy full SHA for 8f2341c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

44 files changed

+595
-102
lines changed

‎.github/workflows/build.yml

Copy file name to clipboardExpand all lines: .github/workflows/build.yml
+23-10Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run_tests: ${{ steps.check.outputs.run_tests }}
1919
run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }}
2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222
- name: Check for source changes
2323
id: check
2424
run: |
@@ -50,8 +50,8 @@ jobs:
5050
needs: check_source
5151
if: needs.check_source.outputs.run_tests == 'true'
5252
steps:
53-
- uses: actions/checkout@v2
54-
- uses: actions/setup-python@v2
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-python@v4
5555
- name: Install Dependencies
5656
run: |
5757
sudo ./.github/workflows/posix-deps-apt.sh
@@ -72,10 +72,23 @@ jobs:
7272
needs: check_source
7373
if: needs.check_source.outputs.run_tests == 'true'
7474
steps:
75-
- uses: actions/checkout@v2
76-
- uses: actions/setup-python@v2
75+
- uses: actions/checkout@v4
76+
- uses: actions/setup-python@v4
7777
- name: Install Dependencies
7878
run: sudo ./.github/workflows/posix-deps-apt.sh
79+
- name: Check Autoconf version 2.69 and aclocal 1.16.3
80+
run: |
81+
grep "Generated by GNU Autoconf 2.69" configure
82+
grep "aclocal 1.16.3" aclocal.m4
83+
grep -q "runstatedir" configure
84+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
85+
- name: Configure CPython
86+
run: |
87+
# Build Python with the libpython dynamic library
88+
./configure --config-cache --with-pydebug --enable-shared
89+
- name: Regenerate autoconf files
90+
run: |
91+
make regen-configure
7992
- name: Build CPython
8093
run: |
8194
./configure --with-pydebug
@@ -99,7 +112,7 @@ jobs:
99112
needs: check_source
100113
if: needs.check_source.outputs.run_tests == 'true'
101114
steps:
102-
- uses: actions/checkout@v2
115+
- uses: actions/checkout@v4
103116
- name: Build CPython
104117
run: .\PCbuild\build.bat -e -p Win32
105118
- name: Display build info
@@ -113,7 +126,7 @@ jobs:
113126
needs: check_source
114127
if: needs.check_source.outputs.run_tests == 'true'
115128
steps:
116-
- uses: actions/checkout@v2
129+
- uses: actions/checkout@v4
117130
- name: Build CPython
118131
run: .\PCbuild\build.bat -e -p x64
119132
- name: Display build info
@@ -131,7 +144,7 @@ jobs:
131144
HOMEBREW_NO_AUTO_UPDATE: 1
132145
HOMEBREW_NO_INSTALL_CLEANUP: 1
133146
steps:
134-
- uses: actions/checkout@v2
147+
- uses: actions/checkout@v4
135148
- name: Install Homebrew dependencies
136149
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
137150
- name: Configure CPython
@@ -160,7 +173,7 @@ jobs:
160173
env:
161174
OPENSSL_VER: 1.1.1v
162175
steps:
163-
- uses: actions/checkout@v2
176+
- uses: actions/checkout@v4
164177
- name: Install Dependencies
165178
run: sudo ./.github/workflows/posix-deps-apt.sh
166179
- name: Configure OpenSSL env vars
@@ -206,7 +219,7 @@ jobs:
206219
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
207220
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
208221
steps:
209-
- uses: actions/checkout@v2
222+
- uses: actions/checkout@v4
210223
- name: Install Dependencies
211224
run: sudo ./.github/workflows/posix-deps-apt.sh
212225
- name: Configure OpenSSL env vars

‎.github/workflows/build_msi.yml

Copy file name to clipboardExpand all lines: .github/workflows/build_msi.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
name: 'Windows (x86) Installer'
2424
runs-on: windows-latest
2525
steps:
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2727
- name: Build CPython installer
2828
run: .\Tools\msi\build.bat -x86
2929

3030
build_win_amd64:
3131
name: 'Windows (x64) Installer'
3232
runs-on: windows-latest
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v4
3535
- name: Build CPython installer
3636
run: .\Tools\msi\build.bat -x64

‎.github/workflows/coverage.yml

Copy file name to clipboardExpand all lines: .github/workflows/coverage.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
env:
2626
OPENSSL_VER: 1.1.1n
2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v4
2929
- name: Install Dependencies
3030
run: sudo ./.github/workflows/posix-deps-apt.sh
3131
- name: 'Restore OpenSSL build'
@@ -73,7 +73,7 @@ jobs:
7373
name: 'Ubuntu (C Coverage)'
7474
runs-on: ubuntu-latest
7575
steps:
76-
- uses: actions/checkout@v2
76+
- uses: actions/checkout@v4
7777
- name: Install Dependencies
7878
run: sudo ./.github/workflows/posix-deps-apt.sh
7979
- name: Configure CPython

‎.github/workflows/doc.yml

Copy file name to clipboardExpand all lines: .github/workflows/doc.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
name: 'Docs'
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2626
- name: 'Install Dependencies'
2727
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
2828
- name: 'Configure CPython'

‎.github/workflows/verify-ensurepip-wheels.yml

Copy file name to clipboardExpand all lines: .github/workflows/verify-ensurepip-wheels.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
verify:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
- uses: actions/setup-python@v4
2525
with:
2626
python-version: '3'

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,11 @@ Tools/ssl/win32
120120
# Ignore ./python binary on Unix but still look into ./Python/ directory.
121121
/python
122122
!/Python/
123+
124+
# Artifacts generated by 3.11 lying around when switching branches:
125+
/_bootstrap_python
126+
/Programs/_freeze_module
127+
/Modules/Setup.bootstrap
128+
/Modules/Setup.stdlib
129+
/Python/deepfreeze/
130+
/Python/frozen_modules/

‎.readthedocs.yml

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is a dummy config file so that readthedocs.org doesn't fail on security branches.
2+
# Note that this won't result in docs actually getting built;
3+
# clicking on the docs preview link on a PR will result in a 404.
4+
version: 2
5+
formats: []
6+
build:
7+
os: "ubuntu-22.04"
8+
tools:
9+
python: "3.11"
10+
jobs:
11+
post_checkout:
12+
- exit 183

‎Doc/constraints.txt

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# We have upper bounds on our transitive dependencies here
2+
# To avoid new releases unexpectedly breaking our build.
3+
# This file can be updated on an ad-hoc basis,
4+
# though it will probably have to be updated
5+
# whenever Doc/requirements.txt is updated.
6+
7+
# Direct dependencies of Sphinx
8+
babel<3
9+
colorama<0.5
10+
imagesize<1.5
11+
Jinja2<3.2
12+
packaging<24
13+
Pygments>=2.16.1,<3
14+
requests<3
15+
snowballstemmer<3
16+
sphinxcontrib-applehelp<1.0.5
17+
sphinxcontrib-devhelp<1.0.6
18+
sphinxcontrib-htmlhelp<2.0.5
19+
sphinxcontrib-jsmath<1.1
20+
sphinxcontrib-qthelp<1.0.7
21+
sphinxcontrib-serializinghtml<1.1.10
22+
23+
# Direct dependencies of Jinja2 (Jinja is a dependency of Sphinx, see above)
24+
MarkupSafe<2.2

‎Doc/requirements.txt

Copy file name to clipboardExpand all lines: Doc/requirements.txt
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ sphinx==2.4.4
1010
docutils==0.17.1
1111
# Jinja version is pinned to a version compatible with Sphinx version 2.4.4.
1212
jinja2==3.0.3
13+
# Alabaster version is pinned to a version compatible with Sphinx version 2.4.4.
14+
alabaster==0.7.13
1315

1416
blurb
1517

1618
# The theme used by the documentation is stored separately, so we need
1719
# to install that as well.
1820
python-docs-theme
21+
22+
-c constraints.txt

‎Include/patchlevel.h

Copy file name to clipboardExpand all lines: Include/patchlevel.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
/*--start constants--*/
1919
#define PY_MAJOR_VERSION 3
2020
#define PY_MINOR_VERSION 8
21-
#define PY_MICRO_VERSION 17
21+
#define PY_MICRO_VERSION 18
2222
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
2323
#define PY_RELEASE_SERIAL 0
2424

2525
/* Version as a string */
26-
#define PY_VERSION "3.8.17+"
26+
#define PY_VERSION "3.8.18+"
2727
/*--end constants--*/
2828

2929
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
Binary file not shown.

‎Lib/site.py

Copy file name to clipboardExpand all lines: Lib/site.py
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import builtins
7575
import _sitebuiltins
7676
import io
77+
import stat
7778

7879
# Prefixes for site-packages; add additional prefixes like /usr/local here
7980
PREFIXES = [sys.prefix, sys.exec_prefix]
@@ -156,6 +157,13 @@ def addpackage(sitedir, name, known_paths):
156157
else:
157158
reset = False
158159
fullname = os.path.join(sitedir, name)
160+
try:
161+
st = os.lstat(fullname)
162+
except OSError:
163+
return
164+
if ((getattr(st, 'st_flags', 0) & stat.UF_HIDDEN) or
165+
(getattr(st, 'st_file_attributes', 0) & stat.FILE_ATTRIBUTE_HIDDEN)):
166+
return
159167
try:
160168
f = io.TextIOWrapper(io.open_code(fullname))
161169
except OSError:
@@ -203,7 +211,8 @@ def addsitedir(sitedir, known_paths=None):
203211
names = os.listdir(sitedir)
204212
except OSError:
205213
return
206-
names = [name for name in names if name.endswith(".pth")]
214+
names = [name for name in names
215+
if name.endswith(".pth") and not name.startswith(".")]
207216
for name in sorted(names):
208217
addpackage(sitedir, name, known_paths)
209218
if reset:

‎Lib/ssl.py

Copy file name to clipboardExpand all lines: Lib/ssl.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,11 @@ def _create(cls, sock, server_side=False, do_handshake_on_connect=True,
10481048
self.close()
10491049
except OSError:
10501050
pass
1051-
raise notconn_pre_handshake_data_error
1051+
try:
1052+
raise notconn_pre_handshake_data_error
1053+
finally:
1054+
# Explicitly break the reference cycle.
1055+
notconn_pre_handshake_data_error = None
10521056
else:
10531057
connected = True
10541058

‎Lib/tempfile.py

Copy file name to clipboardExpand all lines: Lib/tempfile.py
+18-9Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,22 @@ def _mkstemp_inner(dir, pre, suf, flags, output_type):
263263
raise FileExistsError(_errno.EEXIST,
264264
"No usable temporary file name found")
265265

266+
def _dont_follow_symlinks(func, path, *args):
267+
# Pass follow_symlinks=False, unless not supported on this platform.
268+
if func in _os.supports_follow_symlinks:
269+
func(path, *args, follow_symlinks=False)
270+
elif _os.name == 'nt' or not _os.path.islink(path):
271+
func(path, *args)
272+
273+
def _resetperms(path):
274+
try:
275+
chflags = _os.chflags
276+
except AttributeError:
277+
pass
278+
else:
279+
_dont_follow_symlinks(chflags, path, 0)
280+
_dont_follow_symlinks(_os.chmod, path, 0o700)
281+
266282

267283
# User visible interfaces.
268284

@@ -786,17 +802,10 @@ def __init__(self, suffix=None, prefix=None, dir=None):
786802
def _rmtree(cls, name):
787803
def onerror(func, path, exc_info):
788804
if issubclass(exc_info[0], PermissionError):
789-
def resetperms(path):
790-
try:
791-
_os.chflags(path, 0)
792-
except AttributeError:
793-
pass
794-
_os.chmod(path, 0o700)
795-
796805
try:
797806
if path != name:
798-
resetperms(_os.path.dirname(path))
799-
resetperms(path)
807+
_resetperms(_os.path.dirname(path))
808+
_resetperms(path)
800809

801810
try:
802811
_os.unlink(path)

‎Lib/test/test_codecencodings_iso2022.py

Copy file name to clipboardExpand all lines: Lib/test/test_codecencodings_iso2022.py
+46Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,52 @@ class Test_ISO2022_JP2(multibytecodec_support.TestBase, unittest.TestCase):
2424
(b'ab\x1BNdef', 'replace', 'abdef'),
2525
)
2626

27+
class Test_ISO2022_JP3(multibytecodec_support.TestBase, unittest.TestCase):
28+
encoding = 'iso2022_jp_3'
29+
tstring = multibytecodec_support.load_teststring('iso2022_jp')
30+
codectests = COMMON_CODEC_TESTS + (
31+
(b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
32+
(b'\x1B$(O\x2E\x23\x1B(B', 'strict', '\u3402' ),
33+
(b'\x1B$(O\x2E\x22\x1B(B', 'strict', '\U0002000B' ),
34+
(b'\x1B$(O\x24\x77\x1B(B', 'strict', '\u304B\u309A'),
35+
(b'\x1B$(P\x21\x22\x1B(B', 'strict', '\u4E02' ),
36+
(b'\x1B$(P\x7E\x76\x1B(B', 'strict', '\U0002A6B2' ),
37+
('\u3402', 'strict', b'\x1B$(O\x2E\x23\x1B(B'),
38+
('\U0002000B', 'strict', b'\x1B$(O\x2E\x22\x1B(B'),
39+
('\u304B\u309A', 'strict', b'\x1B$(O\x24\x77\x1B(B'),
40+
('\u4E02', 'strict', b'\x1B$(P\x21\x22\x1B(B'),
41+
('\U0002A6B2', 'strict', b'\x1B$(P\x7E\x76\x1B(B'),
42+
(b'ab\x1B$(O\x2E\x21\x1B(Bdef', 'replace', 'ab\uFFFDdef'),
43+
('ab\u4FF1def', 'replace', b'ab?def'),
44+
)
45+
xmlcharnametest = (
46+
'\xAB\u211C\xBB = \u2329\u1234\u232A',
47+
b'\x1B$(O\x29\x28\x1B(B&real;\x1B$(O\x29\x32\x1B(B = &lang;&#4660;&rang;'
48+
)
49+
50+
class Test_ISO2022_JP2004(multibytecodec_support.TestBase, unittest.TestCase):
51+
encoding = 'iso2022_jp_2004'
52+
tstring = multibytecodec_support.load_teststring('iso2022_jp')
53+
codectests = COMMON_CODEC_TESTS + (
54+
(b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
55+
(b'\x1B$(Q\x2E\x23\x1B(B', 'strict', '\u3402' ),
56+
(b'\x1B$(Q\x2E\x22\x1B(B', 'strict', '\U0002000B' ),
57+
(b'\x1B$(Q\x24\x77\x1B(B', 'strict', '\u304B\u309A'),
58+
(b'\x1B$(P\x21\x22\x1B(B', 'strict', '\u4E02' ),
59+
(b'\x1B$(P\x7E\x76\x1B(B', 'strict', '\U0002A6B2' ),
60+
('\u3402', 'strict', b'\x1B$(Q\x2E\x23\x1B(B'),
61+
('\U0002000B', 'strict', b'\x1B$(Q\x2E\x22\x1B(B'),
62+
('\u304B\u309A', 'strict', b'\x1B$(Q\x24\x77\x1B(B'),
63+
('\u4E02', 'strict', b'\x1B$(P\x21\x22\x1B(B'),
64+
('\U0002A6B2', 'strict', b'\x1B$(P\x7E\x76\x1B(B'),
65+
(b'ab\x1B$(Q\x2E\x21\x1B(Bdef', 'replace', 'ab\u4FF1def'),
66+
('ab\u4FF1def', 'replace', b'ab\x1B$(Q\x2E\x21\x1B(Bdef'),
67+
)
68+
xmlcharnametest = (
69+
'\xAB\u211C\xBB = \u2329\u1234\u232A',
70+
b'\x1B$(Q\x29\x28\x1B(B&real;\x1B$(Q\x29\x32\x1B(B = &lang;&#4660;&rang;'
71+
)
72+
2773
class Test_ISO2022_KR(multibytecodec_support.TestBase, unittest.TestCase):
2874
encoding = 'iso2022_kr'
2975
tstring = multibytecodec_support.load_teststring('iso2022_kr')

‎Lib/test/test_httpservers.py

Copy file name to clipboardExpand all lines: Lib/test/test_httpservers.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,10 @@ def test_undecodable_filename(self):
417417
def test_undecodable_parameter(self):
418418
# sanity check using a valid parameter
419419
response = self.request(self.base_url + '/?x=123').read()
420-
self.assertRegex(response, f'listing for {self.base_url}/\?x=123'.encode('latin1'))
420+
self.assertRegex(response, f'listing for {self.base_url}/\\?x=123'.encode('latin1'))
421421
# now the bogus encoding
422422
response = self.request(self.base_url + '/?x=%bb').read()
423-
self.assertRegex(response, f'listing for {self.base_url}/\?x=\xef\xbf\xbd'.encode('latin1'))
423+
self.assertRegex(response, f'listing for {self.base_url}/\\?x=\xef\xbf\xbd'.encode('latin1'))
424424

425425
def test_get_dir_redirect_location_domain_injection_bug(self):
426426
"""Ensure //evil.co/..%2f../../X does not put //evil.co/ in Location.

‎Lib/test/test_mmap.py

Copy file name to clipboardExpand all lines: Lib/test/test_mmap.py
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,15 @@ def test_access_parameter(self):
240240
# Try writing with PROT_EXEC and without PROT_WRITE
241241
prot = mmap.PROT_READ | getattr(mmap, 'PROT_EXEC', 0)
242242
with open(TESTFN, "r+b") as f:
243-
m = mmap.mmap(f.fileno(), mapsize, prot=prot)
244-
self.assertRaises(TypeError, m.write, b"abcdef")
245-
self.assertRaises(TypeError, m.write_byte, 0)
246-
m.close()
243+
try:
244+
m = mmap.mmap(f.fileno(), mapsize, prot=prot)
245+
except PermissionError:
246+
# on macOS 14, PROT_READ | PROT_WRITE is not allowed
247+
pass
248+
else:
249+
self.assertRaises(TypeError, m.write, b"abcdef")
250+
self.assertRaises(TypeError, m.write_byte, 0)
251+
m.close()
247252

248253
def test_bad_file_desc(self):
249254
# Try opening a bad file descriptor...

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.