summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733)Miss Islington (bot)2018-10-061-2/+3
| | | | | (cherry picked from commit ae62f015240c9162773341a9922794e6b960779d) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() ↵Miss Islington (bot)2018-10-051-1/+1
| | | | | | | | | (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>
* bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683)Miss Islington (bot)2018-10-031-1/+1
| | | | | | | | 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>
* [3.6] bpo-34320: Fix dict(o) didn't copy order of dict subclass (GH-8624) ↵Miss Islington (bot)2018-09-261-1/+3
| | | | | | | | | | | | | | | | (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
* Fix Tools/gdb/libpython.pyMiss Islington (bot)2018-09-112-24/+14
| | | | Backport https://github.com/python/cpython/commit/11659d00b9185c8f02ea6b642fa475a80e21f1a9 into this change instead of leaving it a separate followup change.
* [3.6] Fix misleading mentions of tp_size in comments (GH-9137)Benjamin Peterson2018-09-102-3/+3
| | | | | | | 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>
* bpo-25750: fix refcounts in type_getattro() (GH-6118) (GH-9088)Miss Islington (bot)2018-09-071-6/+11
| | | | | | | 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>
* closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)Miss Islington (bot)2018-08-261-1/+1
| | | | | | Reported by Svace static analyzer. (cherry picked from commit b57b4ac042b977e0b42a2f5ddb30ca7edffacfa9) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* closes bpo-34501: PyType_FromSpecWithBases: Check spec->name before ↵Miss Islington (bot)2018-08-251-4/+9
| | | | | | | | dereferencing it. (GH-8930) Reported by Svace static analyzer. (cherry picked from commit 5f79b50763d687aeeed8edcb4efcc7ac9f8fa186) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* closes bpo-34468: Objects/rangeobject.c: Fix an always-false condition in ↵Miss Islington (bot)2018-08-241-4/+4
| | | | | | | | | | | 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>
* closes bpo-34477: Objects/typeobject.c: Add missing NULL check to ↵Miss Islington (bot)2018-08-241-0/+3
| | | | | | | | type_init() (GH-8876) Reported by Svace static analyzer. (cherry picked from commit f6247aac08c1a79d0479145a405718bb76dba434) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* bpo-34436: Fix check that disables overallocation for the last fmt specifier ↵Miss Islington (bot)2018-08-231-3/+3
| | | | | | | | (GH-8826) Reported by Svace static analyzer. (cherry picked from commit ccd99752675042bd5f67d332c5b0ed85ba1f2da3) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* bpo-34435: Add missing NULL check to unicode_encode_ucs1(). (GH-8823)Miss Islington (bot)2018-08-191-2/+3
| | | | | | Reported by Svace static analyzer. (cherry picked from commit 74a307d48ef8b278c4629ca0ef2139be1c9a34e6) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* bpo-24618: Add a check in the code constructor. (GH-8283) (GH-8311)Serhiy Storchaka2018-07-171-5/+24
| | | | | Check that the size of the varnames tuple is enough at least for all arguments. (cherry picked from commit bd47384e07bde38a8f18b90b4cea02a505d95c75)
* fix two typos in Objects/odictobject.c comments (GH-8040)Miss Islington (bot)2018-07-061-2/+2
| | | | | (cherry picked from commit 6f19fc6d5607040ee36153a64a2ed004582af91f) Co-authored-by: Robert Krzyzanowski <technoguyrob@gmail.com>
* bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() ↵Yury Selivanov2018-06-081-8/+7
| | | | (GH-7467) (GH-7507)
* Fix typo in __mul__ and __rmul__ docstring (GH-6674)Miss Islington (bot)2018-05-091-2/+2
| | | | | (cherry picked from commit 0904f766e116c269675317e11368a4d29eef0bc6) Co-authored-by: Grant Jenks <grant.jenks@gmail.com>
* bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)Miss Islington (bot)2018-05-021-1/+3
| | | | | (cherry picked from commit 491bbedc209fea314a04cb3015da68fb0aa63238) Co-authored-by: lekma <lekmalek@gmail.com>
* bpo-33199: Initialize ma_version_tag in PyDict_Copy (GH-6341)Miss Islington (bot)2018-04-031-0/+1
| | | | | (cherry picked from commit d1c82c5cc7be0c21dddf86fd19c1702f6218459b) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* Fix typo and edit for clarity in the docstrings of sys.float_info. (GH-2251)Miss Islington (bot)2018-03-261-3/+2
| | | | | (cherry picked from commit 0301c9bdd1ebd788d1334cf3fe06c48f35bab0dc) Co-authored-by: Stefano Taschini <taschini@users.noreply.github.com>
* bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)Miss Islington (bot)2018-03-171-0/+21
| | | | | | | | 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>
* [3.7] bpo-17288: Prevent jumps from 'return' and 'exception' trace events. ↵Miss Islington (bot)2018-03-131-4/+36
| | | | | | | (GH-5928) (cherry picked from commit e32bbaf376a09c149fa7c7f2919d7c9ce4e2a055) Co-authored-by: xdegaye <xdegaye@gmail.com>
* [3.6] bpo-33026: Fix jumping out of "with" block by setting f_lineno. ↵Miss Islington (bot)2018-03-111-0/+7
| | | | | | | | (GH-6026). (GH-6074) (GH-6075) (cherry picked from commit 26c9f565d016db21257a60d29ab2c99383dd5ac7) (cherry picked from commit 04aadf23eac51fec2e436c5960c1362bbb7d03de) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-18533: Avoid RecursionError from repr() of recursive dictview (GH-4823)Miss Islington (bot)2018-02-261-4/+12
| | | | | | | | | | | | | | | | | | 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)
* bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)INADA Naoki2018-02-132-6/+6
| | | (cherry picked from commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5)
* bpo-32827: Fix usage of _PyUnicodeWriter_Prepare() in decoding errors ↵Miss Islington (bot)2018-02-131-7/+3
| | | | | | | handler. (GH-5636) (cherry picked from commit b7e2d67f7c035f09c921ca4e7a36529cd502ccf7) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.6] bpo-32746: Fix multiple typos (GH-5144) (GH-5522)Terry Jan Reedy2018-02-042-2/+2
| | | | | | | | | 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)
* bpo-32137: The repr of deeply nested dict now raises a RecursionError ↵Miss Islington (bot)2018-02-013-6/+5
| | | | | | | | (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)
* [3.6] bpo-32583: Fix possible crashing in builtin Unicode decoders (GH-5325) ↵Xiang Zhang2018-01-311-2/+20
| | | | | | | (#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)
* [3.6] Revert "bpo-32690: Preserve order of locals() (GH-5379) (#5390)"Nick Coghlan2018-01-301-2/+2
| | | | | This reverts commit 9105879bfd7133ecbac67f3e9c0bacf6e477de5a in order to keep the behaviour of locals() consistent between 3.6.4 and 3.6.5+.
* bpo-32690: Preserve order of locals() (GH-5379) (#5390)Miss Islington (bot)2018-01-281-2/+2
| | | (cherry picked from commit a4d00012565d716db6e6abe1b8f33eaaa4de416e)
* bpo-32685: Improve suggestion for print statement (GH-5380)Miss Islington (bot)2018-01-281-14/+19
| | | | | | | | 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. (cherry picked from commit 43c0f1ac5ed8bc9c3bd048d2ce4de4c98a83de99)
* Fix wrong assert in unicodeobject (GH-5340)Miss Islington (bot)2018-01-271-1/+1
| | | (cherry picked from commit 7cc95f5069c8983afb8a55928db6956abe2d5afa)
* [3.6] bpo-32028: Fix suggestions for indented print statements (GH-5249)Miss Islington (bot)2018-01-201-5/+11
| | | | | | | | 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. (cherry picked from commit d57f26c753dce61f72b52b96db3a3253d9f2fc3e)
* Removed unnecesssary bit inversion which doesn't improve dispersion ↵Miss Islington (bot)2018-01-181-1/+1
| | | | | statistics (GH-5235) (#5236) (cherry picked from commit fa7880604191f81cbdddc191216f7b1e39a74d8d)
* bpo-26163: Frozenset hash improvement (GH-5194) (#5198)Miss Islington (bot)2018-01-161-0/+1
| | | (cherry picked from commit b44c5169f64178d2ff2914187b315549e7ab0cb6)
* [3.6] bpo-32555: Fix locale encodings (#5193)Victor Stinner2018-01-151-10/+26
| | | | | | | | | | | | | | | | | On FreeBSD and Solaris, os.strerror() now always decode the byte string from the current locale encoding, rather than using ASCII/surrogateescape in some cases. Changes: * Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() which has an additional current_locale parameter. * PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize() and * PyUnicode_EncodeLocale() now always use the current locale * encoding, instead of using Py_DecodeLocale()/Py_EncodeLocale(). * Document encoding in Py_DecodeLocale() and Py_EncodeLocale() documentations. * Add USE_FORCE_ASCII define to not define decode_ascii_surrogateescape() on Android.
* Fix outdated comment in typeobject.c (GH-5090)Miss Islington (bot)2018-01-041-1/+1
| | | | | | | The comment was added in 3abca127fe1565ec80f6b0a1ae48d65186ad887d. In d78448e912126410117723c7d240bbdfff06df16, it was changed to use PyArg_ParseTuple instead. (cherry picked from commit 78e24d4415c37e9e9951920bc31e9ee4868d86cb)
* bpo-31619: Fixed integer overflow in converting huge strings to int. ↵Miss Islington (bot)2017-12-031-3/+11
| | | | | (GH-3884) (#4690) (cherry picked from commit 29ba688034fc4eef0693b86002cf7bee55d692af)
* [3.6] bpo-32176: Set CO_NOFREE in the code object constructor (GH-4684)Nick Coghlan2017-12-031-1/+9
| | | | | | | | | Previously, CO_NOFREE was set in the compiler, which meant it could end up being set incorrectly when code objects were created directly. Setting it in the constructor based on freevars and cellvars ensures it is always accurate, regardless of how the code object is defined. (cherry picked from commit 078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34)
* [3.6] bpo-30923, bpo-31279: Fix GCC warnings (#4620)Victor Stinner2017-11-291-1/+1
| | | | | | | | | | * bpo-30923: Silence fall-through warnings in libexpat build. (#3205) (cherry picked from commit 9e1e6f528f3fec16b9bd99f5ee38048ffec04a81) * bpo-31279: Silence -Wstringop-overflow warning. (#3207) (cherry picked from commit dce6502059f46a04f90938b9d832394c8215397b)
* bpo-16055: Fixes incorrect error text for int('1', base=1000) (GH-4376) (#4389)Miss Islington (bot)2017-11-141-1/+1
| | | (cherry picked from commit 28b624825eb92cb8c96fbf8da267d8d14a61a841)
* bpo-31626: Fixed a bug in debug memory allocator. (GH-3844) (#4191)Miss Islington (bot)2017-10-311-11/+2
| | | | | Removed a code that incorrectly detected in-place resizing in realloc() and wrote to freed memory. (cherry picked from commit b484d5606ca76f9bbd0f5de7a6ef753400213e94)
* [3.6] bpo-20047: Make bytearray methods partition() and rpartition() ↵Serhiy Storchaka2017-10-294-24/+47
| | | | | | rejecting (GH-4158) (#4162) separators that are not bytes-like objects.. (cherry picked from commit a2314283ff87c65e1745a42c2f2b716b1a209128)
* [3.6] bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327). ↵xdegaye2017-10-261-32/+0
| | | | | (#4135) (cherry picked from commit 56d1f5ca32892c7643eb8cee49c40c1644f1abfe)
* bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (GH-4058) (#4059)Miss Islington (bot)2017-10-202-2/+2
| | | | and in codecs.escape_decode() when decode an escaped non-ascii byte. (cherry picked from commit 56cb465cc93dcb35aaf7266ca3dbe2dcff1fac5f)
* [3.6] bpo-31655: Validate keyword names in SimpleNamespace constructor. ↵Miss Islington (bot)2017-10-071-1/+5
| | | | | (GH-3909) (#3920) (cherry picked from commit 79ba471488b936abda5ba5234b1ea90cbc94cae6)
* [3.6] bpo-31619: Fixed a ValueError when convert a string with large number ↵Miss Islington (bot)2017-10-031-4/+4
| | | | | | of underscores (GH-3827) (#3863) to integer with binary base. (cherry picked from commit 85c0b8941f0c8ef3ed787c9d504712c6ad3eb5d3)
* [3.6] bpo-31492: Fix assertion failures in case of a module with a bad ↵Serhiy Storchaka2017-09-271-4/+1
| | | | | __name__ attribute. (GH-3620). (#3773) (cherry picked from commit 6db7033192cd537ca987a65971acb01206c3ba82)
* [3.6] bpo-31579: Fixed a possible leak in enumerate() with large indices. ↵Serhiy Storchaka2017-09-261-3/+9
| | | | | (GH-3753). (#3760) (cherry picked from commit 0e950dd22b075b4809c84afda8aede02b76ac0fa)