| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
| |
(cherry picked from commit 815280eb160af637e1347213659f9236adf78f80)
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#18630)
Fix a regression where the C pickle module wouldn't allow unpickling from a
file-like object that doesn't expose a readinto() method.
(cherry picked from commit 9f37872e307734666a7169f7be6e3370d3068282)
Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
|
|
|
|
|
|
|
| |
(#18584)
(cherry picked from commit 90930e65455f60216f09d175586139242dbba260)
Authored-by: Stefan Krah <skrah@bytereef.org>
|
|
|
|
|
|
|
|
| |
(cherry picked from commit c0cb8beb389da3ba67ad31b1ecc95e100b6292ab)
Co-authored-by: Stefan Krah <skrah@bytereef.org>
Co-authored-by: Stefan Krah <skrah@bytereef.org>
|
|
|
|
|
|
|
|
|
|
| |
(GH-18569) (#18574)
(cherry picked from commit 1246d892038a693304549f8574e6c2784b91589a)
Co-authored-by: Stefan Krah <skrah@bytereef.org>
Co-authored-by: Stefan Krah <skrah@bytereef.org>
|
|
|
|
|
|
|
|
| |
(cherry picked from commit 9b833e00e447a3b8b6966686bff701f549c66263)
Co-authored-by: Stefan Krah <skrah@bytereef.org>
Co-authored-by: Stefan Krah <skrah@bytereef.org>
|
|
|
|
|
|
| |
`resource`, `shutil`, `signal`, `syslog` (GH-18407)
Co-authored-by: Saiyang Gou <gousaiyang@163.com>
|
|
|
|
|
| |
(cherry picked from commit 597ebed748d0b0c061f8c108bd98270d103286c1)
Co-authored-by: Andy Lester <andy@petdance.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either:
Adding the const to the type cast, as in:
- return _PyUnicode_FromUCS1((unsigned char*)s, size);
+ return _PyUnicode_FromUCS1((const unsigned char*)s, size);
or, Removing the cast entirely, because it's not necessary (but probably was at one time), as in:
- PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno);
+ PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);
These changes will not change code, but they will make it much easier to check for errors in consts
(cherry picked from commit e6be9b59a911626d6597fe148c32f0342bd2bd24)
Co-authored-by: Andy Lester <andy@petdance.com>
|
|
|
|
|
|
|
|
|
|
| |
(GH-18421) (GH-18423)
(cherry picked from commit c6dedde160a9fce5d049e860f586ad8f93aec822)
Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>
Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
|
|
|
| |
modules (GH-17824)
(cherry picked from commit 95f60010219e142a436fae18e1695cbc45407afe)
Co-authored-by: Saiyang Gou <gousaiyang@163.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When called on a closed object, readinto() segfaults on account
of a write to a freed buffer:
==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==220553== Access not within mapped region at address 0x2A
==220553== at 0x48408A0: memmove (vg_replace_strmem.c:1272)
==220553== by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972)
==220553== by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053)
==220553== by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253)
Reproducer:
reader = open ("/dev/zero", "rb")
_void = reader.read (42)
reader.close ()
reader.readinto (bytearray (42)) GH-GH-GH- BANG!
The problem exists since 2012 when commit dc469454ec added code
to free the read buffer on close().
Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
(cherry picked from commit cb1c0746f277052e45a60d6c436a765e34722821)
Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Pickler instance (GH-18266) (#18316)
https://bugs.python.org/issue39492
Automerge-Triggered-By: @pitrou
(cherry picked from commit 0f2f35e)
Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
|
|
|
|
|
|
|
| |
(GH-18093)
(cherry picked from commit 13c1c3556f2c12d0be2af890fabfbf44280b845c)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
| |
Some portions of the pickle documentation hadn't been updated for the pickle protocol changes in Python 3.8 (new protocol 5, default protocol 4). This PR fixes those docs.
https://bugs.python.org/issue39426
(cherry picked from commit e9652e8d58392f5022759ba06b444ce970eb12db)
Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-18118)
* bpo-39421: Fix posible crash in heapq with custom comparison operators
* fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators
* fixup! fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators
(cherry picked from commit 79f89e6e5a659846d1068e8b1bd8e491ccdef861)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-17964)
Although the underlying libffi issue remains open, adding these
checks have caused problems in third-party projects which are in
widespread use. See the issue for examples.
The corresponding tests have also been skipped.
(cherry picked from commit c12440c371025bea9c3bfb94945f006c486c2c01)
|
|
|
|
|
|
|
| |
_sharedexception_bind. (GH-17908)
(cherry picked from commit 5cae042f686cc174e00093944dc118914c874b7c)
Co-authored-by: Alex Henrie <alexhenrie24@gmail.com>
|
|
|
|
|
|
| |
(cherry picked from commit e02ab59fdffa0bb841182c30ef1355c89578d945)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test_openssl_version now accepts version 3.0.0.
getpeercert() no longer returns IPv6 addresses with a trailing new line.
Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue38820
(cherry picked from commit 2b7de6696bf2f924cd2cd9ff0a539c8aa37c6244)
Co-authored-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue38820
Automerge-Triggered-By: @tiran
|
|
|
|
|
|
|
| |
version (GH-17484)
(cherry picked from commit 969ae7aca809a8dacafee04c261110eea0ac1945)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On most platforms, the `environ` symbol is accessible everywhere.
In a dylib on OSX, it's not easily accessible, you need to find it with
_NSGetEnviron.
The code was caching the *value* of environ. But a setenv() can change the value,
leaving garbage at the old value. Fix: don't cache the value of environ, just
read it every time.
(cherry picked from commit 723f71abf7ab0a7be394f9f7b2daa9ecdf6fb1eb)
Co-authored-by: Benoit Hudson <benoit@imgspc.com>
|
|
|
|
|
|
|
| |
Use the "volatile" keyword to prevent tail call optimization
on any compiler, rather than relying on compiler specific pragma.
(cherry picked from commit 8b787964e0a647caa0558b7c29ae501470d727d9)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The readline module now detects if Python is linked to libedit at runtime
on all platforms. Previously, the check was only done on macOS.
If Python is used as a library by a binary linking to libedit, the linker
resolves the rl_initialize symbol required by the readline module against
libedit instead of libreadline, which leads to a segfault.
Take advantage of the existing supporting code to have readline module being
compatible with both situations.
(cherry picked from commit 7105319ada2e663659020cbe9fdf7ff38f421ab2)
Co-authored-by: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
|
|
|
|
| |
Increment properly Py_True/Py_False reference counter for
_testcapi.WITH_PYMALLOC variable.
|
|
|
|
|
| |
(cherry picked from commit d51a363a4379385fdfe9c09a56324631465ede29)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit ac2235432c607ce2c0faf6dff5d9b2534d2f6652)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
|
|
|
|
|
|
| |
argument (GH-17243)
(cherry picked from commit dcf1f83de8678b09df5bd7d04ca5f4ef1cd02aca)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
|
|
|
|
| |
(cherry picked from commit 00923c63995e34cdc25d699478f113de99a69df9)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
|
|
|
|
|
| |
https://bugs.python.org/issue38823
(cherry picked from commit 289cf0fbf78c4f38c38ac71ac8b772be7ec2672f)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
|
|
|
|
| |
(GH-17223)
(cherry picked from commit 106271568c58cfebae58f0c52b640dbe716ba2ce)
|
|
|
|
|
|
| |
https://bugs.python.org/issue38823
(cherry picked from commit 143a97f64128070386b12a0ee589bdaad5e51f40)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
|
|
|
|
|
| |
https://bugs.python.org/issue38823
(cherry picked from commit c3f6bdc332d23588102eba749a5929dd5bb67c9d)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit b44ffc8b409fd539c5fb2b79385498e9fe168880)
Co-authored-by: Marco Paolini <mpaolini@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
if parent `__init__` is not called from a constructor of object derived from `asyncio.Future`
https://bugs.python.org/issue38785
(cherry picked from commit dad6be5ffe48beb74fad78cf758b886afddc7aed)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
|
|
|
|
|
| |
files. (GH-17136)
This change, which follows the behavior of C stdio's fdopen and Python 2's file object, allows pipes to be opened in append mode..
(cherry picked from commit 74fa9f723f700a342e582b5ad4b51a2c4801cd1c)
|
|
|
|
|
| |
(cherry picked from commit 6552563b3d5061816720a5a6c7d4ffd6ba35b98b)
Co-authored-by: Alexandru Ardelean <ardeleanalex@gmail.com>
|
|
|
|
|
| |
(GH-16799) (GH-17016)
(cherry picked from commit 79d4ed102a5069c6cebaed2627cb1645637f0429)
|
|
|
|
|
|
|
|
| |
https://bugs.python.org/issue38418
Automerge-Triggered-By: @zooba
(cherry picked from commit fbe3c76c7ce1eec887d332d801d3784212cc0f73)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)
bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is
now also available in release mode. For example, it can be used to
debug a crash in the visit_decref() function of the GC.
Modify the following functions to also work in release mode:
* _PyDict_CheckConsistency()
* _PyObject_CheckConsistency()
* _PyType_CheckConsistency()
* _PyUnicode_CheckConsistency()
Other changes:
* _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL
(equals to 0).
* _PyBytesWriter_CheckConsistency() now returns 1 and is only used
with assert().
* Reorder _PyObject_Dump() to write safe fields first, and only
attempt to render repr() at the end.
(cherry picked from commit 6876257eaabdb30f27ebcbd7d2557278ce2e5705)
* bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)
Fix _PyBytesWriter API when Python is built in release mode with
assertions.
(cherry picked from commit 60ec6efd96d95476fe5e38c491491add04f026e5)
* bpo-38070: Enhance visit_decref() debug trace (GH-16631)
subtract_refs() now pass the parent object to visit_decref() which
pass it to _PyObject_ASSERT(). So if the "is freed" assertion fails,
the parent is used in debug trace, rather than the freed object. The
parent object is more likely to contain useful information. Freed
objects cannot be inspected are are displayed as "<object at xxx is
freed>" with no other detail.
(cherry picked from commit 4d5f94b8cd20f804c7868c5395a15aa6032f874c)
* Fix also a typo in PYMEM_DEADBYTE macro comment
* bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629)
Add a newline between the verbose object dump and the Py_FatalError()
logs for readability.
(cherry picked from commit 7775349895088a7ae68cecf0c74cf817f15e2c74)
|
|
|
|
|
|
|
| |
_POSIX_C_SOURCE (GH-16733)
(cherry picked from commit 8177404d520e81f16324a900f093adf3856d33f8)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-16658) (GH-16683)
* [bpo-38379](https://bugs.python.org/issue38379): when a finalizer resurrects an object,
nothing is actually collected in this run of gc.
Change the stats to relect that truth.
(cherry picked from commit ecbf35f9335b0420cb8adfda6f299d6747a16515)
Co-authored-by: Tim Peters <tim.peters@gmail.com>
https://bugs.python.org/issue38379
Automerge-Triggered-By: @pablogsal
|
|
|
|
|
| |
structs/unions. (GH-16589) (GH-16671)
(cherry picked from commit e8bedbddadaa86be6bd86dc32dbdbd53933a4988)
|
|
|
|
|
| |
(cherry picked from commit 321def805abc5b7c92c7e90ca90cb2434fdab855)
Co-authored-by: Ben Harper <btharper1221@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-16545)
On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the
"surrogatepass" error handler for converting to/from Tcl Unicode objects.
On Linux use UTF-8 with the "surrogateescape" error handler for converting
to/from Tcl String objects.
Converting strings from Tcl to Python and back now never fails
(except MemoryError).
(cherry picked from commit 06cb94bc8419b9a24df6b0d724fcd8e40c6971d6)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-38321: Fix _asynciomodule.c compiler warning (GH-16493)
bpo-38248, bpo-38321: Fix warning:
modules\_asynciomodule.c(2667):
warning C4102: 'set_exception': unreferenced label
The related goto has been removed by
commit edad4d89e357c92f70c0324b937845d652b20afd.
(cherry picked from commit efe74b6369a8d08f27c69703fcc1686966e51068)
* bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492)
bpo-22273, bpo-38321: Fix following warning:
modules\_ctypes\stgdict.c(704):
warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
(cherry picked from commit c9a413ede47171a224c72dd34122005170caaad4)
|
|
|
|
|
|
|
| |
PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
longer return PyStatus: they cannot fail anymore.
(cherry picked from commit 8462a4936b3a551dc546a6adea04a70b0a07ca67)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
| |
For now, we'll rely on the fact that the config structures aren't covered by the stable ABI.
We may revisit this in the future if we further explore the idea of offering a stable embedding API.
|
|
|
|
|
|
|
|
| |
Fix a bug due to the interaction of weakrefs and the cyclic garbage
collector. We must clear any weakrefs in garbage in order to prevent
their callbacks from executing and causing a crash.
(cherry picked from commit bcda460baf25062ab68622b3f043f52b9db4d21d)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
|