Skip to content

Commit

Permalink
Merge branch 'main' into inlinecomp2
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
carljm committed Feb 10, 2023
2 parents 568a470 + 448c7d1 commit add772e
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/ci.yml
Expand Up @@ -57,7 +57,7 @@ jobs:
variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
openssl_version: 1.1.1q
openssl_version: 1.1.1t

steps:
- template: ./posix-steps.yml
Expand All @@ -83,7 +83,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1q
openssl_version: 1.1.1t

steps:
- template: ./posix-steps.yml
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/pr.yml
Expand Up @@ -57,7 +57,7 @@ jobs:
variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
testRunPlatform: linux
openssl_version: 1.1.1q
openssl_version: 1.1.1t

steps:
- template: ./posix-steps.yml
Expand All @@ -83,7 +83,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1q
openssl_version: 1.1.1t

steps:
- template: ./posix-steps.yml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Expand Up @@ -176,7 +176,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 1.1.1s
OPENSSL_VER: 1.1.1t
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
strategy:
fail-fast: false
matrix:
openssl_ver: [1.1.1s, 3.0.7, 3.1.0-beta1]
openssl_ver: [1.1.1t, 3.0.8, 3.1.0-beta1]
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
Expand Down Expand Up @@ -282,7 +282,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 1.1.1s
OPENSSL_VER: 1.1.1t
PYTHONSTRICTEXTENSIONBUILD: 1
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
steps:
Expand Down
10 changes: 5 additions & 5 deletions Doc/library/subprocess.rst
Expand Up @@ -111,7 +111,7 @@ underlying :class:`Popen` interface can be used directly.
Added the *text* parameter, as a more understandable alias of *universal_newlines*.
Added the *capture_output* parameter.

.. versionchanged:: 3.11.3
.. versionchanged:: 3.12

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

.. versionchanged:: 3.11.3
.. versionchanged:: 3.12

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

.. versionchanged:: 3.11.3
.. versionchanged:: 3.12

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

.. versionchanged:: 3.11.3
.. versionchanged:: 3.12

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

.. versionchanged:: 3.11.3
.. versionchanged:: 3.12

Changed Windows shell search order for ``shell=True``. The current
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_fstring.py
Expand Up @@ -667,7 +667,7 @@ def test_missing_expression(self):
"f'''{\t\f\r\n}'''",
])

# Different error messeges are raised when a specfier ('!', ':' or '=') is used after an empty expression
# Different error messages are raised when a specfier ('!', ':' or '=') is used after an empty expression
self.assertAllRaise(SyntaxError, "f-string: expression required before '!'",
["f'{!r}'",
"f'{ !r}'",
Expand Down
6 changes: 3 additions & 3 deletions Mac/BuildScript/build-installer.py
Expand Up @@ -246,9 +246,9 @@ def library_recipes():

result.extend([
dict(
name="OpenSSL 1.1.1s",
url="https://www.openssl.org/source/openssl-1.1.1s.tar.gz",
checksum='c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa',
name="OpenSSL 1.1.1t",
url="https://www.openssl.org/source/openssl-1.1.1t.tar.gz",
checksum='8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b',
buildrecipe=build_universal_openssl,
configure=None,
install=None,
Expand Down
@@ -0,0 +1,2 @@
Update :mod:`tracemalloc` to handle presize of object properly. Patch by
Dong-hee Na.
@@ -0,0 +1,4 @@
Updated the OpenSSL version used in Windows and macOS binary release builds
to 1.1.1t to address CVE-2023-0286, CVE-2022-4303, and CVE-2022-4303 per
`the OpenSSL 2023-02-07 security advisory
<https://www.openssl.org/news/secadv/20230207.txt>`_.
6 changes: 3 additions & 3 deletions Modules/_io/textio.c
Expand Up @@ -56,10 +56,10 @@ textiobase_detach(PyObject *self, PyObject *Py_UNUSED(ignored))
}

PyDoc_STRVAR(textiobase_read_doc,
"Read at most n characters from stream.\n"
"Read at most size characters from stream.\n"
"\n"
"Read from underlying buffer until we have n characters or we hit EOF.\n"
"If n is negative or omitted, read until EOF.\n"
"Read from underlying buffer until we have size characters or we hit EOF.\n"
"If size is negative or omitted, read until EOF.\n"
);

static PyObject *
Expand Down
24 changes: 8 additions & 16 deletions Modules/_tracemalloc.c
Expand Up @@ -2,6 +2,7 @@
#include "pycore_fileutils.h" // _Py_write_noraise()
#include "pycore_gc.h" // PyGC_Head
#include "pycore_hashtable.h" // _Py_hashtable_t
#include "pycore_object.h" // _PyType_PreHeaderSize
#include "pycore_pymem.h" // _Py_tracemalloc_config
#include "pycore_runtime.h" // _Py_ID()
#include "pycore_traceback.h"
Expand Down Expand Up @@ -1400,20 +1401,16 @@ _tracemalloc__get_object_traceback(PyObject *module, PyObject *obj)
/*[clinic end generated code: output=41ee0553a658b0aa input=29495f1b21c53212]*/
{
PyTypeObject *type;
void *ptr;
traceback_t *traceback;

type = Py_TYPE(obj);
if (PyType_IS_GC(type)) {
ptr = (void *)((char *)obj - sizeof(PyGC_Head));
}
else {
ptr = (void *)obj;
}
const size_t presize = _PyType_PreHeaderSize(type);
uintptr_t ptr = (uintptr_t)((char *)obj - presize);

traceback = tracemalloc_get_traceback(DEFAULT_DOMAIN, (uintptr_t)ptr);
if (traceback == NULL)
traceback = tracemalloc_get_traceback(DEFAULT_DOMAIN, ptr);
if (traceback == NULL) {
Py_RETURN_NONE;
}

return traceback_to_pyobject(traceback, NULL);
}
Expand Down Expand Up @@ -1723,14 +1720,9 @@ _PyTraceMalloc_NewReference(PyObject *op)
return -1;
}

uintptr_t ptr;
PyTypeObject *type = Py_TYPE(op);
if (PyType_IS_GC(type)) {
ptr = (uintptr_t)((char *)op - sizeof(PyGC_Head));
}
else {
ptr = (uintptr_t)op;
}
const size_t presize = _PyType_PreHeaderSize(type);
uintptr_t ptr = (uintptr_t)((char *)op - presize);

int res = -1;

Expand Down
9 changes: 2 additions & 7 deletions Objects/object.c
Expand Up @@ -2387,14 +2387,9 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg,
/* Display the traceback where the object has been allocated.
Do it before dumping repr(obj), since repr() is more likely
to crash than dumping the traceback. */
void *ptr;
PyTypeObject *type = Py_TYPE(obj);
if (_PyType_IS_GC(type)) {
ptr = (void *)((char *)obj - sizeof(PyGC_Head));
}
else {
ptr = (void *)obj;
}
const size_t presize = _PyType_PreHeaderSize(type);
void *ptr = (void *)((char *)obj - presize);
_PyMem_DumpTraceback(fileno(stderr), ptr);

/* This might succeed or fail, but we're about to abort, so at least
Expand Down
1 change: 1 addition & 0 deletions Objects/odictobject.c
Expand Up @@ -1385,6 +1385,7 @@ odict_repr(PyODictObject *self)
result = PyUnicode_FromFormat("%s(%R)",
_PyType_Name(Py_TYPE(self)),
dcopy);
Py_DECREF(dcopy);

Done:
Py_ReprLeave((PyObject *)self);
Expand Down
4 changes: 2 additions & 2 deletions PCbuild/get_externals.bat
Expand Up @@ -53,7 +53,7 @@ echo.Fetching external libraries...
set libraries=
set libraries=%libraries% bzip2-1.0.8
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.4.3
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1s
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1t
set libraries=%libraries% sqlite-3.39.4.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.13.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.13.0
Expand All @@ -77,7 +77,7 @@ echo.Fetching external binaries...

set binaries=
if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi-3.4.3
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1s
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1t
if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.13.0
if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06

Expand Down
4 changes: 2 additions & 2 deletions PCbuild/prepare_libffi.bat
Expand Up @@ -60,7 +60,7 @@ goto :Usage
if NOT DEFINED BUILD_X64 if NOT DEFINED BUILD_X86 if NOT DEFINED BUILD_ARM32 if NOT DEFINED BUILD_ARM64 (
set BUILD_X64=1
set BUILD_X86=1
set BUILD_ARM32=1
set BUILD_ARM32=0
set BUILD_ARM64=1
set COPY_LICENSE=1
)
Expand Down Expand Up @@ -204,7 +204,7 @@ if NOT DEFINED CYG_CACHE (set CYG_CACHE=C:/cygwin/var/cache/setup)
if NOT DEFINED CYG_MIRROR (set CYG_MIRROR=http://mirrors.kernel.org/sourceware/cygwin/)

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

endlocal
Expand Down
4 changes: 2 additions & 2 deletions PCbuild/python.props
Expand Up @@ -74,8 +74,8 @@
<libffiDir Condition="$(libffiDir) == ''">$(ExternalsDir)libffi-3.4.3\</libffiDir>
<libffiOutDir Condition="$(libffiOutDir) == ''">$(libffiDir)$(ArchName)\</libffiOutDir>
<libffiIncludeDir Condition="$(libffiIncludeDir) == ''">$(libffiOutDir)include</libffiIncludeDir>
<opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-1.1.1s\</opensslDir>
<opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-1.1.1s\$(ArchName)\</opensslOutDir>
<opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-1.1.1t\</opensslDir>
<opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-1.1.1t\$(ArchName)\</opensslOutDir>
<opensslIncludeDir Condition="$(opensslIncludeDir) == ''">$(opensslOutDir)include</opensslIncludeDir>
<nasmDir Condition="$(nasmDir) == ''">$(ExternalsDir)\nasm-2.11.06\</nasmDir>
<zlibDir Condition="$(zlibDir) == ''">$(ExternalsDir)\zlib-1.2.13\</zlibDir>
Expand Down
2 changes: 1 addition & 1 deletion PCbuild/readme.txt
Expand Up @@ -169,7 +169,7 @@ _lzma
Homepage:
https://tukaani.org/xz/
_ssl
Python wrapper for version 1.1.1q of the OpenSSL secure sockets
Python wrapper for version 1.1.1t of the OpenSSL secure sockets
library, which is downloaded from our binaries repository at
https://github.com/python/cpython-bin-deps.

Expand Down
4 changes: 2 additions & 2 deletions Parser/asdl_c.py
Expand Up @@ -73,7 +73,7 @@ def reflow_c_string(s, depth):
def is_simple(sum_type):
"""Return True if a sum is a simple.
A sum is simple if it's types have no fields and itself
A sum is simple if its types have no fields and itself
doesn't have any attributes. Instances of these types are
cached at C level, and they act like singletons when propagating
parser generated nodes into Python level, e.g.
Expand Down Expand Up @@ -352,7 +352,7 @@ def visitSum(self, sum, name):
self.visit(t, name, sum.attributes)

def get_args(self, fields):
"""Return list of C argument into, one for each field.
"""Return list of C argument info, one for each field.
Argument info is 3-tuple of a C type, variable name, and flag
that is true if type can be NULL.
Expand Down
4 changes: 2 additions & 2 deletions Tools/ssl/multissltests.py
Expand Up @@ -46,8 +46,8 @@
]

OPENSSL_RECENT_VERSIONS = [
"1.1.1s",
"3.0.7"
"1.1.1t",
"3.0.8"
]

LIBRESSL_OLD_VERSIONS = [
Expand Down

0 comments on commit add772e

Please sign in to comment.