| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix refleak in C module __init_subclass__
This was leaking a reference to the weak cache dictionary for every
ZoneInfo subclass created.
* Fix refleak in ZoneInfo subclass's clear_cache
The previous version of the code accidentally cleared the global
ZONEINFO_STRONG_CACHE variable (and inducing `ZoneInfo` to create a new
strong cache) on calls to a subclass's `clear_cache()`. This would not
affect guaranteed behavior, but it's still not the right thing to do
(and it caused reference leaks).
(cherry picked from commit c3dd7e45cc5d36bbe2295c2840faabb5c75d83e4)
Co-authored-by: Paul Ganssle <paul@ganssle.io>
|
|
|
|
|
|
|
| |
This applies to the default "extc99" mode. Python does not compile with "stdc99".
(cherry picked from commit 40e700ad042089120456cc2ee79b8ca69479416b)
Authored-by: Stefan Krah <skrah@bytereef.org>
|
|
|
|
|
|
|
|
|
|
| |
when peer closes connection during TLS negotiation (GH-18772)
[bpo-31122](): ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation
Reproducer: http://tiny.cc/f4ztnz (tiny url because some bot keeps renaming b.p.o.-nnn as bpo links)
(cherry picked from commit 495bd035662fda29639f9d52bb6baebea31d72fa)
Co-authored-by: Dima Tisnek <dimaqq@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this change, attempting to subclass the C implementation of
zoneinfo.ZoneInfo gave the following error:
TypeError: unbound method ZoneInfo.__init_subclass__() needs an argument
https://bugs.python.org/issue41025
(cherry picked from commit 87d8287865e5c9f137f6b5cf8c34c2c509eb5e9d)
Co-authored-by: Paul Ganssle <paul@ganssle.io>
|
|
|
|
|
|
|
| |
Do not call PyObject_CallMethod() with a live exception (like
KeyboardInterrupt).
(cherry picked from commit eca2549f5a5048b44ca88b9555f1c62f094e3c12)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
| |
(GH-19686)
(cherry picked from commit af4eda46d1538b1da700a86588bdb94b0a4d1ff2)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 0108b2a2401d0ffffe7c07e5ab69a3b0c7593070)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
|
|
|
|
| |
Move definition of UNUSED from modified headers of libmpdec to
_decimal.c itself. This makes the vendored source closer to the
standalone library and fixes build with --with-system-libmpdec.
Tested to build fine with either system libmpdec or the vendored one.
(cherry picked from commit 015efdbef7454a522e88cd79ba2b4cd77a5fb2a2)
Co-authored-by: Felix Yan <felixonmars@archlinux.org>
|
|
|
|
|
|
| |
Automerge-Triggered-By: @tiran
(cherry picked from commit 4f309abf55f0e6f8950ac13d6ec83c22b8d47bf8)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
(GH-21407)
(cherry picked from commit ee96f32ca24779656d3c8736d26671fc3689f0a3)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The running loop holder cache variable was always set to NULL when
calling set_running_loop.
Now set_running_loop saves the newly created running loop holder in the
cache variable for faster access in get_running_loop.
Automerge-Triggered-By: @1st1
(cherry picked from commit 529f42645d38b6b0075f256814dfb3d220ac7d92)
Co-authored-by: Tony Solomonik <tony.solomonik@gmail.com>
|
|
|
|
|
|
|
| |
(GH-21385)
(cherry picked from commit aebc0495572c5bb85d2bd97d27cf93ab038b5a6a)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
|
| |
is embedded (GH-21297)
Also enables using debug build of `python3_d.dll`
Reference: CVE-2020-15523
(cherry picked from commit dcbaa1b49cd9062fb9ba2b9d49555ac6cd8c60b5)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
|
|
|
|
|
|
|
| |
PyUnicode_EncodeDecimal and PyUnicode_TransformDecimalToASCII
are deprecated since Python 3.3.
But Py_DEPRECATED(3.3) was commented out.
(cherry picked from commit 13c90e82b6a1c3baff7f48f1bdc38058f6072f04)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
|
|
|
|
|
|
|
| |
"tp_setattro()" (GH-21092)
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 148f32913573c29250dfb3f0d079eb8847633621)
Co-authored-by: scoder <stefan_ml@behnel.de>
|
|
|
|
|
|
|
| |
asyncio.Task.all_tasks() (GH-20874)
(cherry picked from commit 004e64e8059fe68a72890314673282f2e60d5ce1)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
|
|
|
|
|
|
|
| |
(GH-21202)
(cherry picked from commit 8bea91b5e9ea07ca93958e131b436024f0b1b1cf)
Authored-by: Stefan Krah <skrah@bytereef.org>
|
|
|
|
| |
(#21022)
|
|
|
|
|
|
|
|
| |
tracemalloc_get_frame() checked filename == NULL two times in a row.
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 9cfcdb7d6e4d09bde63bc7116b2ab0d96724527e)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
| |
characters. (GH-21035). (GH-21156)
(cherry picked from commit 700cfa8c90a90016638bac13c4efd03786b2b2a0)
|
|
|
|
|
| |
(cherry picked from commit a7dc71470156680f1fd5243290c6d377824b7ef4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 6c6810d98979add7a89391c3c38990d0859f7a29)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
| |
This was detected by our Coverity scan as a REVERSE_INULL issue.
Automerge-Triggered-By: @gpshead
(cherry picked from commit d780fa7)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
| |
select module (GH-21066) (GH-21097)
(cherry picked from commit d051801052211b533c46a593b1c1bccf649a171c)
Automerge-Triggered-By: @vstinner
|
|
|
|
|
|
|
| |
Fix integer overflow in the :meth:`array.array.index` method on 64-bit Windows
for index larger than ``2**31``.
(cherry picked from commit 1d3dad5f96ed445b958ec53dfa0d46812f2162d9)
Co-authored-by: WildCard65 <WildCard65@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().
(cherry picked from commit c88239f864a27f673c0f0a9e62d2488563f9d081)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 4901ea952691ad70aae21cfe04b6bd363b5a6aff)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
| |
module. (GH-21009)
Detected by Coverity.
(cherry picked from commit eb0d5c38de7f970d8cd8524f4163d831c7720f51)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
| |
(GH-21002). (GH-21030)
(cherry picked from commit 6989af0bc7ea1e9a1acea16794e6f723d7b44110)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
|
|
|
|
|
| |
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 2c4928d37edc5e4aeec3c0b79fa3460b1ec9b60d)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows, GH-include "pyerrors.h" no longer defines "snprintf" and
"vsnprintf" macros.
PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable
behavior.
Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf()
calls with PyOS_vsnprintf().
(cherry picked from commit e822e37946f27c09953bb5733acf3b07c2db690f)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```
Direct leak of 8 byte(s) in 1 object(s) allocated from:
GH-0 0x7f008bf19667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
GH-1 0x7f007a0bee4a in subprocess_fork_exec /home/heimes/dev/python/cpython/Modules/_posixsubprocess.c:774
GH-2 0xe0305b in cfunction_call Objects/methodobject.c:546
```
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 0d3350daa8123a3e16d4a534b6e873eb12c10d7c)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Followup of bpo-40854, there is one remaining usage of PLATLIBDIR
which should be replaced by config->platlibdir.
test_sys checks that sys.platlibdir attribute exists and is a string.
Update Makefile: getpath.c and sysmodule.c no longer need PLATLIBDIR
macro, PyConfig.platlibdir member is used instead.
Co-authored-by: Sandro Mani <manisandro@gmail.com>
(cherry picked from commit d72b9644a3e6eec83be48b1ebc2ec6ca776134d3)
|
|
|
|
|
|
| |
(cherry picked from commit 951d680d56d8c32556437a86f6b42f221635b97f)
Authored-by: Stefan Krah <skrah@bytereef.org>
|
|
|
|
|
|
|
| |
(GH-20605) (GH-20725)
(cherry picked from commit 8f023a2f664f902a3d0b7a6f64d63afc0d1c15ae)
Co-authored-by: Sandro Mani <manisandro@gmail.com>
|
|
|
|
|
|
| |
heapctypewithbuffer_releasebuffer() (GH-20685) (GH-20690)
(cherry picked from commit b8867e5d5aca33511942632b5f4e359b9245b2fa)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
|
|
|
|
| |
This is not part of the limited API but makes the buffer slots available for type specs.
(cherry picked from commit f7c4e236429606e1c982cacf24e10fc86ef4462f)
|
|
|
|
|
| |
(cherry picked from commit ba6fd87e41dceb01dcdacc57c722aca12cde42a9)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 087d612efebe7c64e5f079b07e0454111859830e)
Authored-by: Stefan Krah <skrah@bytereef.org>
|
|
|
|
|
|
| |
Automerge-Triggered-By: @tiran
(cherry picked from commit 6ed578f6dbffdec94f62cc2e36d626fc195678d7)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)
Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if
tstate is NULL, the error message contains the current function name.
(cherry picked from commit 3026cad59b87751a9215111776cac8e819458fce)
* bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)
PyOS_InterruptOccurred() now fails with a fatal error if it is called
with the GIL released.
(cherry picked from commit cbe129692293251e7fbcea9ff0d822824d90c140)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)
Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.
Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.
(cherry picked from commit c353764fd564e401cf47a5d9efab18c72c60014e)
* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)
my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().
my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.
test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().
Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.
(cherry picked from commit fa7ab6aa0f9a4f695e5525db5a113cd21fa93787)
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-40630: Add tracemalloc.reset_peak (GH-20102, cherrypick 8b62644)
The reset_peak function sets the peak memory size to the current size,
representing a resetting of that metric. This allows for recording the
peak of specific sections of code, ignoring other code that may have
had a higher peak (since the most recent `tracemalloc.start()` or
tracemalloc.clear_traces()` call).
* Adjust docs to point to 3.9
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use
``no-deprecated`` and ``--api=1.1.0``.
Note: Tests assume full OpenSSL API and fail with limited API.
Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Wright <gienah@gentoo.org>
(cherry picked from commit a871f692b4a2e6c7d45579693e787edc0af1a02c)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
|
|
| |
run-time (GH-20493) (GH-20495)
Recent changes to _datetimemodule broke compilation on mingw; see the comments in this change for details.
FWIW, @corona10: this issue is why `PyType_FromModuleAndSpec` & friends take the `bases` argument at run time.
(cherry picked from commit 459acc551656785bc4a3363d65c7a60f822da8e3)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyType_FromSpec types (reverts GH-19414) (GH-20264)
Heap types now always visit the type in tp_traverse. See added docs for details.
This reverts commit 0169d3003be3d072751dd14a5c84748ab63a249f.
Automerge-Triggered-By: @encukou
(cherry picked from commit 1cf15af9a6f28750f37b08c028ada31d38e818dd)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
hashlib.compare_digest uses OpenSSL's CRYPTO_memcmp() function
when OpenSSL is available.
Note: The _operator module is a builtin module. I don't want to add
libcrypto dependency to libpython. Therefore I duplicated the wrapper
function and added a copy to _hashopenssl.c..
(cherry picked from commit db5aed931f8a617f7b63e773f62db468fe9c5ca1)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
| |
If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().
(cherry picked from commit 10228bad0452d94e66c964b625a0b61befa08e59)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
| |
```
D:\a\cpython\cpython\Modules\_zoneinfo.c(903,52): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(904,44): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(1772,31): warning C4244: '=': conversion from 'ssize_t' to 'uint8_t', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
```
(cherry picked from commit e4799b95945b44eb0e2eea26473db8e0a49ed0ee)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ctypes now raises an ArgumentError when a callback
is invoked with more than 1024 arguments.
The ctypes module allocates arguments on the stack in
ctypes_callproc() using alloca(), which is problematic
when large numbers of arguments are passed. Instead
of a stack overflow, this commit raises an ArgumentError
if more than 1024 parameters are passed.
(cherry picked from commit 29a1384c040d39659e7d01f1fd7b6eb71ef2634e)
Co-authored-by: Sean Gillespie <sean@swgillespie.me>
|