Skip to content

Commit add772e

Browse files
committed
Merge branch 'main' into inlinecomp2
* main: Fix some typos in asdl_c.py (pythonGH-101757) pythongh-101747: Fix refleak in new `OrderedDict` repr (pythonGH-101748) pythongh-101430: Update tracemalloc to handle presize properly. (pythongh-101745) pythonGH-101228: Fix typo in docstring for read method of `_io.TextIOWrapper` class (python#101227) Fix typo in `test_fstring.py` (python#101600) pythongh-101726: Update the OpenSSL version to 1.1.1t (pythonGH-101727) pythongh-101283: Fix 'versionchanged' for the shell=True fallback on Windows in 3.12 (pythonGH-101728) LibFFI build requires x64 Cygwin, and skip the ARM build (pythonGH-101743)
2 parents 568a470 + 448c7d1 commit add772e

File tree

18 files changed

+47
-53
lines changed

18 files changed

+47
-53
lines changed

.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.1q
60+
openssl_version: 1.1.1t
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.1q
86+
openssl_version: 1.1.1t
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.1q
60+
openssl_version: 1.1.1t
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.1q
86+
openssl_version: 1.1.1t
8787

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

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
needs: check_source
177177
if: needs.check_source.outputs.run_tests == 'true'
178178
env:
179-
OPENSSL_VER: 1.1.1s
179+
OPENSSL_VER: 1.1.1t
180180
PYTHONSTRICTEXTENSIONBUILD: 1
181181
steps:
182182
- uses: actions/checkout@v3
@@ -235,7 +235,7 @@ jobs:
235235
strategy:
236236
fail-fast: false
237237
matrix:
238-
openssl_ver: [1.1.1s, 3.0.7, 3.1.0-beta1]
238+
openssl_ver: [1.1.1t, 3.0.8, 3.1.0-beta1]
239239
env:
240240
OPENSSL_VER: ${{ matrix.openssl_ver }}
241241
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -282,7 +282,7 @@ jobs:
282282
needs: check_source
283283
if: needs.check_source.outputs.run_tests == 'true'
284284
env:
285-
OPENSSL_VER: 1.1.1s
285+
OPENSSL_VER: 1.1.1t
286286
PYTHONSTRICTEXTENSIONBUILD: 1
287287
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
288288
steps:

Doc/library/subprocess.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ underlying :class:`Popen` interface can be used directly.
111111
Added the *text* parameter, as a more understandable alias of *universal_newlines*.
112112
Added the *capture_output* parameter.
113113

114-
.. versionchanged:: 3.11.3
114+
.. versionchanged:: 3.12
115115

116116
Changed Windows shell search order for ``shell=True``. The current
117117
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
@@ -495,7 +495,7 @@ functions.
495495
*executable* parameter accepts a bytes and :term:`path-like object`
496496
on Windows.
497497

498-
.. versionchanged:: 3.11.3
498+
.. versionchanged:: 3.12
499499

500500
Changed Windows shell search order for ``shell=True``. The current
501501
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
@@ -1174,7 +1174,7 @@ calls these functions.
11741174
.. versionchanged:: 3.3
11751175
*timeout* was added.
11761176

1177-
.. versionchanged:: 3.11.3
1177+
.. versionchanged:: 3.12
11781178

11791179
Changed Windows shell search order for ``shell=True``. The current
11801180
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
@@ -1214,7 +1214,7 @@ calls these functions.
12141214
.. versionchanged:: 3.3
12151215
*timeout* was added.
12161216

1217-
.. versionchanged:: 3.11.3
1217+
.. versionchanged:: 3.12
12181218

12191219
Changed Windows shell search order for ``shell=True``. The current
12201220
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
@@ -1277,7 +1277,7 @@ calls these functions.
12771277
.. versionadded:: 3.7
12781278
*text* was added as a more readable alias for *universal_newlines*.
12791279

1280-
.. versionchanged:: 3.11.3
1280+
.. versionchanged:: 3.12
12811281

12821282
Changed Windows shell search order for ``shell=True``. The current
12831283
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and

Lib/test/test_fstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ def test_missing_expression(self):
667667
"f'''{\t\f\r\n}'''",
668668
])
669669

670-
# Different error messeges are raised when a specfier ('!', ':' or '=') is used after an empty expression
670+
# Different error messages are raised when a specfier ('!', ':' or '=') is used after an empty expression
671671
self.assertAllRaise(SyntaxError, "f-string: expression required before '!'",
672672
["f'{!r}'",
673673
"f'{ !r}'",

Mac/BuildScript/build-installer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ def library_recipes():
246246

247247
result.extend([
248248
dict(
249-
name="OpenSSL 1.1.1s",
250-
url="https://www.openssl.org/source/openssl-1.1.1s.tar.gz",
251-
checksum='c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa',
249+
name="OpenSSL 1.1.1t",
250+
url="https://www.openssl.org/source/openssl-1.1.1t.tar.gz",
251+
checksum='8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b',
252252
buildrecipe=build_universal_openssl,
253253
configure=None,
254254
install=None,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update :mod:`tracemalloc` to handle presize of object properly. Patch by
2+
Dong-hee Na.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Updated the OpenSSL version used in Windows and macOS binary release builds
2+
to 1.1.1t to address CVE-2023-0286, CVE-2022-4303, and CVE-2022-4303 per
3+
`the OpenSSL 2023-02-07 security advisory
4+
<https://www.openssl.org/news/secadv/20230207.txt>`_.

Modules/_io/textio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ textiobase_detach(PyObject *self, PyObject *Py_UNUSED(ignored))
5656
}
5757

5858
PyDoc_STRVAR(textiobase_read_doc,
59-
"Read at most n characters from stream.\n"
59+
"Read at most size characters from stream.\n"
6060
"\n"
61-
"Read from underlying buffer until we have n characters or we hit EOF.\n"
62-
"If n is negative or omitted, read until EOF.\n"
61+
"Read from underlying buffer until we have size characters or we hit EOF.\n"
62+
"If size is negative or omitted, read until EOF.\n"
6363
);
6464

6565
static PyObject *

Modules/_tracemalloc.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "pycore_fileutils.h" // _Py_write_noraise()
33
#include "pycore_gc.h" // PyGC_Head
44
#include "pycore_hashtable.h" // _Py_hashtable_t
5+
#include "pycore_object.h" // _PyType_PreHeaderSize
56
#include "pycore_pymem.h" // _Py_tracemalloc_config
67
#include "pycore_runtime.h" // _Py_ID()
78
#include "pycore_traceback.h"
@@ -1400,20 +1401,16 @@ _tracemalloc__get_object_traceback(PyObject *module, PyObject *obj)
14001401
/*[clinic end generated code: output=41ee0553a658b0aa input=29495f1b21c53212]*/
14011402
{
14021403
PyTypeObject *type;
1403-
void *ptr;
14041404
traceback_t *traceback;
14051405

14061406
type = Py_TYPE(obj);
1407-
if (PyType_IS_GC(type)) {
1408-
ptr = (void *)((char *)obj - sizeof(PyGC_Head));
1409-
}
1410-
else {
1411-
ptr = (void *)obj;
1412-
}
1407+
const size_t presize = _PyType_PreHeaderSize(type);
1408+
uintptr_t ptr = (uintptr_t)((char *)obj - presize);
14131409

1414-
traceback = tracemalloc_get_traceback(DEFAULT_DOMAIN, (uintptr_t)ptr);
1415-
if (traceback == NULL)
1410+
traceback = tracemalloc_get_traceback(DEFAULT_DOMAIN, ptr);
1411+
if (traceback == NULL) {
14161412
Py_RETURN_NONE;
1413+
}
14171414

14181415
return traceback_to_pyobject(traceback, NULL);
14191416
}
@@ -1723,14 +1720,9 @@ _PyTraceMalloc_NewReference(PyObject *op)
17231720
return -1;
17241721
}
17251722

1726-
uintptr_t ptr;
17271723
PyTypeObject *type = Py_TYPE(op);
1728-
if (PyType_IS_GC(type)) {
1729-
ptr = (uintptr_t)((char *)op - sizeof(PyGC_Head));
1730-
}
1731-
else {
1732-
ptr = (uintptr_t)op;
1733-
}
1724+
const size_t presize = _PyType_PreHeaderSize(type);
1725+
uintptr_t ptr = (uintptr_t)((char *)op - presize);
17341726

17351727
int res = -1;
17361728

Objects/object.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,14 +2387,9 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg,
23872387
/* Display the traceback where the object has been allocated.
23882388
Do it before dumping repr(obj), since repr() is more likely
23892389
to crash than dumping the traceback. */
2390-
void *ptr;
23912390
PyTypeObject *type = Py_TYPE(obj);
2392-
if (_PyType_IS_GC(type)) {
2393-
ptr = (void *)((char *)obj - sizeof(PyGC_Head));
2394-
}
2395-
else {
2396-
ptr = (void *)obj;
2397-
}
2391+
const size_t presize = _PyType_PreHeaderSize(type);
2392+
void *ptr = (void *)((char *)obj - presize);
23982393
_PyMem_DumpTraceback(fileno(stderr), ptr);
23992394

24002395
/* This might succeed or fail, but we're about to abort, so at least

Objects/odictobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,7 @@ odict_repr(PyODictObject *self)
13851385
result = PyUnicode_FromFormat("%s(%R)",
13861386
_PyType_Name(Py_TYPE(self)),
13871387
dcopy);
1388+
Py_DECREF(dcopy);
13881389

13891390
Done:
13901391
Py_ReprLeave((PyObject *)self);

PCbuild/get_externals.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ echo.Fetching external libraries...
5353
set libraries=
5454
set libraries=%libraries% bzip2-1.0.8
5555
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.4.3
56-
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1s
56+
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1t
5757
set libraries=%libraries% sqlite-3.39.4.0
5858
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.13.0
5959
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.13.0
@@ -77,7 +77,7 @@ echo.Fetching external binaries...
7777

7878
set binaries=
7979
if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi-3.4.3
80-
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1s
80+
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1t
8181
if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.13.0
8282
if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06
8383

PCbuild/prepare_libffi.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ goto :Usage
6060
if NOT DEFINED BUILD_X64 if NOT DEFINED BUILD_X86 if NOT DEFINED BUILD_ARM32 if NOT DEFINED BUILD_ARM64 (
6161
set BUILD_X64=1
6262
set BUILD_X86=1
63-
set BUILD_ARM32=1
63+
set BUILD_ARM32=0
6464
set BUILD_ARM64=1
6565
set COPY_LICENSE=1
6666
)
@@ -204,7 +204,7 @@ if NOT DEFINED CYG_CACHE (set CYG_CACHE=C:/cygwin/var/cache/setup)
204204
if NOT DEFINED CYG_MIRROR (set CYG_MIRROR=http://mirrors.kernel.org/sourceware/cygwin/)
205205

206206
powershell -c "md $env:CYG_ROOT -ErrorAction SilentlyContinue"
207-
powershell -c "$setup = $env:CYG_ROOT+'/setup.exe'; if (!(Test-Path $setup)){invoke-webrequest https://cygwin.com/setup-x86.exe -outfile $setup}
207+
powershell -c "$setup = $env:CYG_ROOT+'/setup.exe'; if (!(Test-Path $setup)){invoke-webrequest https://cygwin.com/setup-x86_64.exe -outfile $setup}
208208
%CYG_ROOT%/setup.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P make -P autoconf -P automake -P libtool -P dejagnu
209209

210210
endlocal

PCbuild/python.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
<libffiDir Condition="$(libffiDir) == ''">$(ExternalsDir)libffi-3.4.3\</libffiDir>
7575
<libffiOutDir Condition="$(libffiOutDir) == ''">$(libffiDir)$(ArchName)\</libffiOutDir>
7676
<libffiIncludeDir Condition="$(libffiIncludeDir) == ''">$(libffiOutDir)include</libffiIncludeDir>
77-
<opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-1.1.1s\</opensslDir>
78-
<opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-1.1.1s\$(ArchName)\</opensslOutDir>
77+
<opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-1.1.1t\</opensslDir>
78+
<opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-1.1.1t\$(ArchName)\</opensslOutDir>
7979
<opensslIncludeDir Condition="$(opensslIncludeDir) == ''">$(opensslOutDir)include</opensslIncludeDir>
8080
<nasmDir Condition="$(nasmDir) == ''">$(ExternalsDir)\nasm-2.11.06\</nasmDir>
8181
<zlibDir Condition="$(zlibDir) == ''">$(ExternalsDir)\zlib-1.2.13\</zlibDir>

PCbuild/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ _lzma
169169
Homepage:
170170
https://tukaani.org/xz/
171171
_ssl
172-
Python wrapper for version 1.1.1q of the OpenSSL secure sockets
172+
Python wrapper for version 1.1.1t of the OpenSSL secure sockets
173173
library, which is downloaded from our binaries repository at
174174
https://github.com/python/cpython-bin-deps.
175175

Parser/asdl_c.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def reflow_c_string(s, depth):
7373
def is_simple(sum_type):
7474
"""Return True if a sum is a simple.
7575
76-
A sum is simple if it's types have no fields and itself
76+
A sum is simple if its types have no fields and itself
7777
doesn't have any attributes. Instances of these types are
7878
cached at C level, and they act like singletons when propagating
7979
parser generated nodes into Python level, e.g.
@@ -352,7 +352,7 @@ def visitSum(self, sum, name):
352352
self.visit(t, name, sum.attributes)
353353

354354
def get_args(self, fields):
355-
"""Return list of C argument into, one for each field.
355+
"""Return list of C argument info, one for each field.
356356
357357
Argument info is 3-tuple of a C type, variable name, and flag
358358
that is true if type can be NULL.

Tools/ssl/multissltests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
]
4747

4848
OPENSSL_RECENT_VERSIONS = [
49-
"1.1.1s",
50-
"3.0.7"
49+
"1.1.1t",
50+
"3.0.8"
5151
]
5252

5353
LIBRESSL_OLD_VERSIONS = [

0 commit comments

Comments
 (0)