| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Fix an assertion error in format() in debug build for floating point
formatting with "n" format, zero padding and small width. Release build is
not impacted. Patch by Karthikeyan Singaravelan.
(cherry picked from commit 3f7983a25a3d19779283c707fbdd5bc91b1587ef)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
|
|
|
|
|
|
|
|
| |
(GH-11047) (GH-11107) (GH-11108)
(cherry picked from commit bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d)
(cherry picked from commit 3cae16d2e98ffaa89ddd311df70a857dfaff4020)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
(GH-11077) (GH-11106)
(cherry picked from commit 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6)
|
|
|
|
|
|
|
|
|
| |
(GH-11015) (GH-11020) (GH-11026)
(cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
(cherry picked from commit 602d307ac5e8a2da38a193dca3bdfef5994dfe67)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 4013c179117754b039957db4730880bf3285919d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
(GH-10796)
Fix warnings with gcc 8 for wrapperfunc <-> wrapperfunc_kwds casts.
(cherry picked from commit 1c607155c9e363489036ae6258b165a3fae75134)
|
|
|
|
|
|
| |
(cherry picked from commit 81524022d0c0df7a41f9b2b2df41e2ebe140e610)
(cherry picked from commit ad8ac54aa3d2323bdb5feb5e858a922840358187)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
(GH-10749)
Fix also return type for few other functions (clear, releasebuffer).
(cherry picked from commit d4f9cf5545d6d8844e0726552ef2e366f5cc3abd)
|
|
|
|
|
|
|
| |
Copy code from master: add assertions on start and value, replace 'i'
iterator with 'end' pointer for the loop stop condition.
_PyUnicode_FastFill(): fix type of 'data', it must not be constant,
since data is modified by FILL().
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10720)
Fix str.format(), float.__format__() and complex.__format__() methods
for non-ASCII decimal point when using the "n" formatter.
Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires
a _PyUnicodeWriter object for the buffer and a Python str object
for digits.
(cherry picked from commit 59423e3ddd736387cef8f7632c71954c1859bed0)
(cherry picked from commit 6f5fa1b4be735159e964906ab608dc467476e47c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-9263: _PyObject_Dump() detects freed memory (GH-10061)
_PyObject_Dump() now uses an heuristic to check if the object memory
has been freed: log "<freed object>" in that case.
The heuristic rely on the debug hooks on Python memory allocators
which fills the memory with DEADBYTE (0xDB) when memory is
deallocated. Use PYTHONMALLOC=debug to always enable these debug
hooks.
(cherry picked from commit 82af0b63b07aa8d92b50098e382b458143cfc677)
* bpo-9263: Fix _PyObject_Dump() for freed object (#10661)
If _PyObject_Dump() detects that the object is freed, don't try to
dump it (exit immediately).
Enhance also _PyObject_IsFreed(): it now detects if the pointer
itself looks like freed memory.
(cherry picked from commit 2cf5d32fd9e61488e8b0be55a2e92a752ba8b06b)
(cherry picked from commit 95036ea25d47f0081bda2ba96ea327f3375cb6a4)
|
|
|
|
|
|
|
|
|
| |
Discovered using clang's MemorySanitizer when it ran python3's
test_fstring test_misformed_unicode_character_name.
An msan build will fail by simply executing: ./python -c 'u"\N"'
(cherry picked from commit 746b2d35ea47005054ed774fecaed64fab803d7d)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
| |
Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER.
Project based C Preprocessor namespacing at its finest. :P
(cherry picked from commit 3015fb8ce4d25603434b9b44bb7effb98a481532)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
| |
clang's MemorySanitizer understand getc() but does not understand
getc_unlocked(). Workaround: Don't use it on msan builds.
(cherry picked from commit e6c77d8301ec1703abb755a7d3ce5bd8c999c082)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
address_in_range(). (GH-10442)
This function may access memory which is mapped but is considered
free by libc allocator. It behaves so by design, therefore we
need to suppress sanitizer reports.
GCC doesn't support MSan, so disable only TSan for it.
(cherry picked from commit fd3a91cbf93dd7bd97f01add9c90075d63cd7316)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
| |
(cherry picked from commit c9a6168924ffa4f3f78175998b392fe23d3edc50)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
| |
Constructing bytes from mutating list could cause a crash.
(cherry picked from commit 914f9a078f997e58cfcfabcbb30fafdd1f277bef)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
(GH-10001)
(cherry picked from commit 6f17e51345d930ccb4db306acc12b7d1f6c5e690)
|
|
|
|
|
|
|
| |
(GH-9051)
(cherry picked from commit a5259fb05d03f4871837c14fed704541a20896c0)
Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(GH-9199)
Address a C undefined behavior signed integer overflow issue in set object table resizing. Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings.
(cherry picked from commit 6c7d67ce83a62b5f0fe5c53a6df602827451bf7f)
Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(GH-9852)
bytes and bytearray constructors converted unexpected exceptions
(e.g. MemoryError and KeyboardInterrupt) to TypeError.
(cherry picked from commit e890421e334ccf0c000c6b29c4a521d86cd12f47)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-9583)
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>
https://bugs.python.org/issue34320
|
|
|
|
| |
Backport https://github.com/python/cpython/commit/11659d00b9185c8f02ea6b642fa475a80e21f1a9
into this change instead of leaving it a separate followup change.
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
| |
(cherry picked from commit 6f19fc6d5607040ee36153a64a2ed004582af91f)
Co-authored-by: Robert Krzyzanowski <technoguyrob@gmail.com>
|
|
|
|
| |
(GH-7467) (GH-7507)
|
|
|
|
|
| |
(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 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)
(cherry picked from commit e32bbaf376a09c149fa7c7f2919d7c9ce4e2a055)
Co-authored-by: xdegaye <xdegaye@gmail.com>
|
|
|
|
|
|
|
|
| |
(GH-6026). (GH-6074) (GH-6075)
(cherry picked from commit 26c9f565d016db21257a60d29ab2c99383dd5ac7)
(cherry picked from commit 04aadf23eac51fec2e436c5960c1362bbb7d03de)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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().
(cherry picked from commit d7773d92bd11640a8c950d6c36a9cef1cee36f96)
|
|
|
| |
(cherry picked from commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5)
|
|
|
|
|
|
|
| |
handler. (GH-5636)
(cherry picked from commit b7e2d67f7c035f09c921ca4e7a36529cd502ccf7)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Fix typos found by codespell in docs, docstrings, and comments.
Fixes for the following files were in post-3.6 code and not backported:
Lib/ctypes/_aix.py (new), Lib/test/test_concurrent_futures.py,
Modules/_asynciomodule.c, Modules/_pickle.c, Objects/obmalloc.c.
(cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80)
|
|
|
|
|
|
|
|
| |
(GH-4570) (GH-4689)
instead of crashing due to a stack overflow.
This perhaps will fix similar problems in other extension types.
(cherry picked from commit 1fb72d2ad243c965d4432b4e93884064001a2607)
|
|
|
|
|
|
|
| |
(#5459)
When using customized decode error handlers, it is possible for builtin decoders
to write out-of-bounds and then crash..
(cherry picked from commit 2c7fd46e11333ef5e5cce34212f7d087694f3658)
|