| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
(cherry picked from commit ae62f015240c9162773341a9922794e6b960779d)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
(GH-9705)
The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
(cherry picked from commit 7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
|
| |
formatfloat() was not checking if PyBytes_FromStringAndSize()
failed, which could lead to a null pointer dereference in
_PyBytes_FormatEx().
(cherry picked from commit 96c593279400693226d5a560c420ae0fcf1731b9)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
When dict subclass overrides order (`__iter__()`, `keys()`, and `items()`), `dict(o)`
should use it instead of dict ordering.
https://bugs.python.org/issue34320
(cherry picked from commit 2aaf98c16ae3070378de523a173e29644037d8bd)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
Many type object initializations labeled a field "tp_size" in the
comment, but the name of that field is tp_basicsize..
(cherry picked from commit 0e0bc4e221f592f305d335faf5f8046484eb9238)
Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
|
| |
|
|
|
|
|
| |
When calling tp_descr_get(self, obj, type), make sure that
we own a strong reference to "self".
(cherry picked from commit 8f735485acf2e35a75d2fa019feb8f905598c4e5)
Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
|
| |
|
|
|
|
| |
Reported by Svace static analyzer.
(cherry picked from commit b57b4ac042b977e0b42a2f5ddb30ca7edffacfa9)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
| |
|
|
|
|
|
|
| |
dereferencing it. (GH-8930)
Reported by Svace static analyzer.
(cherry picked from commit 5f79b50763d687aeeed8edcb4efcc7ac9f8fa186)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
| |
|
|
|
|
|
| |
compute_cr_origin() (GH-8911)
(cherry picked from commit 8fdd331bbf7e60dd81c02c7077f44c7939e2a05d)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
| |
|
|
|
|
|
|
|
|
|
| |
range_repr() (GH-8880)
Also, propagate the error from PyNumber_AsSsize_t() because we don't care
only about OverflowError which is not reported if the second argument is NULL.
Reported by Svace static analyzer.
(cherry picked from commit 7ecae3ca0bda3cacf3b0125bae0bc718a17cc071)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
| |
|
|
|
|
|
|
| |
type_init() (GH-8876)
Reported by Svace static analyzer.
(cherry picked from commit f6247aac08c1a79d0479145a405718bb76dba434)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
| |
|
|
|
|
|
|
| |
(GH-8826)
Reported by Svace static analyzer.
(cherry picked from commit ccd99752675042bd5f67d332c5b0ed85ba1f2da3)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
| |
|
|
|
|
| |
Reported by Svace static analyzer.
(cherry picked from commit 74a307d48ef8b278c4629ca0ef2139be1c9a34e6)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
|
| |
Check that the size of the varnames tuple is enough at least for all arguments.
(cherry picked from commit bd47384e07bde38a8f18b90b4cea02a505d95c75)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
`_PyUnicode_TransformDecimalAndSpaceToASCII()` missed trailing NUL char.
It caused buffer overflow in `_Py_string_to_number_with_underscores()`.
This bug is introduced in 9b6c60cb.
(cherry picked from commit 16dfca4d829e45f36e71bf43f83226659ce49315)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 0b75228700e0077d8bf2636e74733389514b4b2f)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
| |
|
|
|
| |
(cherry picked from commit 6f19fc6d5607040ee36153a64a2ed004582af91f)
Co-authored-by: Robert Krzyzanowski <technoguyrob@gmail.com>
|
| |
|
|
|
|
| |
Also, standardize indentation of generated tables.
(cherry picked from commit 7c69c1c0fba8c1c8ff3969bce4c1135736a4cc58)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
| |
|
|
|
| |
(cherry picked from commit 0904f766e116c269675317e11368a4d29eef0bc6)
Co-authored-by: Grant Jenks <grant.jenks@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 491bbedc209fea314a04cb3015da68fb0aa63238)
Co-authored-by: lekma <lekmalek@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 61f82e0e337f971da57f8f513abfe693edf95aa5)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix clang ubsan (undefined behavior sanitizer) warnings in dictobject.c by
adjusting how the internal struct _dictkeysobject shared keys structure is
declared.
This remains ABI compatible. We get rid of the union at the end of the
struct being used for conveinence to avoid typecasting in favor of char[]
variable length array at the end of a struct. This is known to clang to be
used for variable sized objects and will not cause an undefined behavior
problem. Similarly, char arrays do not have strict aliasing undefined
behavior when cast.
PEP-007 does not currently list variable length arrays (VLAs) as allowed
in our subset of C99. If this turns out to be a problem, the fix to this is
to change the char `dk_indices[]` into `dk_indices[1]` and restore the
three size computation subtractions this change removes:
`- Py_MEMBER_SIZE(PyDictKeysObject, dk_indices)`
If this works as is I'll make a separate PR to update PEP-007.
(cherry picked from commit 397f1b28c4a12e3b3ed59a89599eabc457412649)
|
| |
|
|
|
| |
(cherry picked from commit 5fbc511f56688654a05b9eba23d140318bb9b2d5)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
(GH-6120) (GH-6433)
This code doesn't have effect on the final result, but causes
GCC 8 warnings and can have an undefined behavior.
(cherry picked from commit 827d49f3cf0296f1e267eae6834a977cf312cc1e)
|
| |
|
|
|
| |
(cherry picked from commit d1c82c5cc7be0c21dddf86fd19c1702f6218459b)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 0301c9bdd1ebd788d1334cf3fe06c48f35bab0dc)
Co-authored-by: Stefano Taschini <taschini@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
Multi-phase initialized modules allow m_traverse to be called while the
module is still being initialized, so module authors may need to account
for that.
(cherry picked from commit c2b0b12d1a137ada1023ab7c10b8d9a0249d95f9)
Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
|
| |
|
|
| |
(GH-5928)
|
| |
|
|
|
|
|
| |
(GH-6026). (#6074)
(cherry picked from commit 26c9f565d016db21257a60d29ab2c99383dd5ac7)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 745dc65b17b3936e3f9f4099f735f174d30c4e0c)
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5)
Co-authored-by: Oren Milman <orenmn@gmail.com>
|
| |
|
|
|
|
|
|
| |
handler. (GH-5636) (GH-5650)
(cherry picked from commit b7e2d67f7c035f09c921ca4e7a36529cd502ccf7)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
| |
Fix typos found by codespell in docs, docstrings, and comments.
(cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80)
Co-authored-by: Leo Arias <leo.arias@canonical.com>
|
| |
|
|
|
| |
When using customized decode error handlers, it is possible for builtin decoders
to write out-of-bounds and then crash.
|
| |
|
|
|
| |
(GH-5410)
The commit removes one unnecessary "if" clause in genobject.c. That "if" clause was masking un-awaited coroutines warnings just to make writing unittests more convenient.
|
| | |
|
| |
|
|
| |
(#582)
|
| | |
|
| |
|
|
|
|
|
| |
Better account for single-line compound statements and
semi-colon separated statements when suggesting
Py3 replacements for Py2 print statements.
Initial patch by Nitish Chandra.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dictview_repr(): Use a Py_ReprEnter() / Py_ReprLeave() pair to check
for recursion, and produce "..." if so.
test_recursive_repr(): Check for the string rather than a
RecursionError. (Test cannot be any tighter as contents are
implementation-dependent.)
test_deeply_nested_repr(): Add new test, replacing the original
test_recursive_repr(). It checks that a RecursionError is raised in
the case of a non-recursive but deeply nested structure. (Very
similar to what test_repr_deep() in test/test_dict.py does for a
normal dict.)
OrderedDictTests: Add new test case, to test behavior on OrderedDict
instances containing their own values() or items().
|
| |
|
| |
Reported by Coverity Scan.
|
| |
|
|
|
| |
(GH-5222)
Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth
* Use coroutine origin information in the unawaited coroutine warning
* Stop using set_coroutine_wrapper in asyncio debug mode
* In BaseEventLoop.set_debug, enable debugging in the correct thread
|
| |
|
|
|
|
|
| |
The suggested replacement for print statements previously failed to account
for leading whitespace and hence could end up including unwanted text in
the proposed call to the print builtin.
Patch by Sanyam Khurana.
|