Skip to content

Commit ce29809

Browse files
Merge branch '140052-pytuple-make-pair' of github.com:sergey-miryanov/cpython into 140052-pytuple-make-pair
2 parents 7c0eaa4 + e27f3a1 commit ce29809

File tree

11 files changed

+38
-40
lines changed

11 files changed

+38
-40
lines changed

Doc/library/zlib.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99

1010
For applications that require data compression, the functions in this module
1111
allow compression and decompression, using the zlib library. The zlib library
12-
has its own home page at https://www.zlib.net. There are known
13-
incompatibilities between the Python module and versions of the zlib library
14-
earlier than 1.1.3; 1.1.3 has a `security vulnerability <https://zlib.net/zlib_faq.html#faq33>`_, so we recommend using
15-
1.1.4 or later.
12+
has its own home page at https://www.zlib.net. zlib 1.2.2.1 is the minium
13+
supported version.
1614

1715
zlib's functions have many options and often need to be used in a particular
1816
order. This documentation doesn't attempt to cover all of the permutations;

Doc/using/configure.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,26 @@ To build optional modules:
2626

2727
* `libbz2 <https://sourceware.org/bzip2/>`_ for the :mod:`bz2` module.
2828

29-
* `libb2 <https://github.com/BLAKE2/libb2>`_ (:ref:`BLAKE2 <hashlib-blake2>`),
30-
used by :mod:`hashlib` module.
29+
* `libb2 <https://github.com/BLAKE2/libb2>`_ (:ref:`BLAKE2 <hashlib-blake2>`)
30+
for the :mod:`hashlib` module.
3131

3232
* `libffi <https://sourceware.org/libffi/>`_ 3.3.0 is the recommended
3333
minimum version for the :mod:`ctypes` module.
3434

35-
* ``liblzma``, for the :mod:`lzma` module.
35+
* ``liblzma`` for the :mod:`lzma` module.
3636

3737
* `libmpdec <https://www.bytereef.org/mpdecimal/doc/libmpdec/>`_ 2.5.0
3838
for the :mod:`decimal` module.
3939

40-
* ``libncurses`` or ``libncursesw``,
41-
for the :mod:`curses` module.
40+
* ``libncurses`` or ``libncursesw`` for the :mod:`curses` module.
4241

43-
* ``libpanel`` or ``libpanelw``,
44-
for the :mod:`curses.panel` module.
42+
* ``libpanel`` or ``libpanelw`` for the :mod:`curses.panel` module.
4543

4644
* `libreadline <https://tiswww.case.edu/php/chet/readline/rltop.html>`_ or
4745
`libedit <https://www.thrysoee.dk/editline/>`_
4846
for the :mod:`readline` module.
4947

50-
* `libuuid <https://linux.die.net/man/3/libuuid>`_, for the :mod:`uuid` module.
48+
* `libuuid <https://linux.die.net/man/3/libuuid>`_ for the :mod:`uuid` module.
5149

5250
* `OpenSSL <https://www.openssl.org/>`_ 1.1.1 is the minimum version and
5351
OpenSSL 3.0.18 is the recommended minimum version for the
@@ -57,7 +55,7 @@ To build optional modules:
5755

5856
* `Tcl/Tk <https://www.tcl-lang.org/>`_ 8.5.12 for the :mod:`tkinter` module.
5957

60-
* `zlib <https://www.zlib.net>`_ 1.1.4 is the reccomended minimum version for the
58+
* `zlib <https://www.zlib.net>`_ 1.2.2.1 is the minimum version for the
6159
:mod:`zlib` module.
6260

6361
* `zstd <https://facebook.github.io/zstd/>`_ 1.4.5 is the minimum version for

Include/internal/pycore_interp_structs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,12 @@ struct _is {
769769
* and should be placed at the beginning. */
770770
struct _ceval_state ceval;
771771

772+
/* This structure is carefully allocated so that it's correctly aligned
773+
* to avoid undefined behaviors during LOAD and STORE. The '_malloced'
774+
* field stores the allocated pointer address that will later be freed.
775+
*/
776+
void *_malloced;
777+
772778
PyInterpreterState *next;
773779

774780
int64_t id;

Lib/urllib/error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class URLError(OSError):
2020
# URLError is a sub-type of OSError, but it doesn't share any of
21-
# the implementation. need to override __init__ and __str__.
21+
# the implementation. It overrides __init__ and __str__.
2222
# It sets self.args for compatibility with other OSError
2323
# subclasses, but args doesn't have the typical format with errno in
2424
# slot 0 and strerror in slot 1. This may be better than nothing.

Misc/NEWS.d/next/Core_and_Builtins/2025-10-14-17-07-37.gh-issue-140067.ID2gOm.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

Objects/bytearrayobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,14 +1469,14 @@ bytearray_removesuffix_impl(PyByteArrayObject *self, Py_buffer *suffix)
14691469
/*[clinic input]
14701470
bytearray.resize
14711471
size: Py_ssize_t
1472-
New size to resize to..
1472+
New size to resize to.
14731473
/
14741474
Resize the internal buffer of bytearray to len.
14751475
[clinic start generated code]*/
14761476

14771477
static PyObject *
14781478
bytearray_resize_impl(PyByteArrayObject *self, Py_ssize_t size)
1479-
/*[clinic end generated code: output=f73524922990b2d9 input=75fd4d17c4aa47d3]*/
1479+
/*[clinic end generated code: output=f73524922990b2d9 input=6c9a260ca7f72071]*/
14801480
{
14811481
Py_ssize_t start_size = PyByteArray_GET_SIZE(self);
14821482
int result = PyByteArray_Resize((PyObject *)self, size);

Objects/clinic/bytearrayobject.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class object "PyObject *" "&PyBaseObject_Type"
8181

8282
#define END_TYPE_DICT_LOCK() Py_END_CRITICAL_SECTION2()
8383

84-
#ifdef Py_DEBUG
84+
#ifndef NDEBUG
8585
// Return true if the world is currently stopped.
8686
static bool
8787
types_world_is_stopped(void)

Python/pystate.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -457,19 +457,16 @@ _PyInterpreterState_Enable(_PyRuntimeState *runtime)
457457
static PyInterpreterState *
458458
alloc_interpreter(void)
459459
{
460-
// Aligned allocation for PyInterpreterState.
461-
// the first word of the memory block is used to store
462-
// the original pointer to be used later to free the memory.
463460
size_t alignment = _Alignof(PyInterpreterState);
464-
size_t allocsize = sizeof(PyInterpreterState) + sizeof(void *) + alignment - 1;
461+
size_t allocsize = sizeof(PyInterpreterState) + alignment - 1;
465462
void *mem = PyMem_RawCalloc(1, allocsize);
466463
if (mem == NULL) {
467464
return NULL;
468465
}
469-
void *ptr = _Py_ALIGN_UP((char *)mem + sizeof(void *), alignment);
470-
((void **)ptr)[-1] = mem;
471-
assert(_Py_IS_ALIGNED(ptr, alignment));
472-
return ptr;
466+
PyInterpreterState *interp = _Py_ALIGN_UP(mem, alignment);
467+
assert(_Py_IS_ALIGNED(interp, alignment));
468+
interp->_malloced = mem;
469+
return interp;
473470
}
474471

475472
static void
@@ -484,7 +481,7 @@ free_interpreter(PyInterpreterState *interp)
484481
interp->obmalloc = NULL;
485482
}
486483
assert(_Py_IS_ALIGNED(interp, _Alignof(PyInterpreterState)));
487-
PyMem_RawFree(((void **)interp)[-1]);
484+
PyMem_RawFree(interp->_malloced);
488485
}
489486
}
490487

configure

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)