summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* [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)
* [3.6] bpo-30923: Silence fall-through warnings included in -Wextra since ↵Victor Stinner2017-09-122-4/+5
| | | | | | | | | | | | | | | | gcc-7.0 (#3518) * bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142) (cherry picked from commit d73a960c575207539c3f9765cff26d4fff400b45) * bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. (#3157) (cherry picked from commit f432a3234f9f2ee09bd40be03e06bf72865ee375) * bpo-31275: Small refactoring to silence a fall-through warning. (#3206) (cherry picked from commit 138753c1b96b5e06a5c5d409fa4cae5e2fe1108b)
* [3.6] bpo-31373: remove overly strict float range checks (GH-3486) (#3495)Benjamin Peterson2017-09-121-2/+2
| | | | | | This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be rounded into finite floats. Tests were added to very this behavior. (cherry picked from commit 2bb69a5b4e7f96cb35d1b28aa7b7b3974b351f59)
* Backport docstring improvements to OrderedDict. (GH-3470)Henk-Jaap Wagenaar2017-09-111-4/+6
|
* [3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). (#3453)Serhiy Storchaka2017-09-083-7/+16
| | | (cherry picked from commit e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c)
* [3.6] fixes bpo-31373: fix undefined floating-point demotions (GH-3396) (#3424)Miss Islington (bot)2017-09-071-4/+6
| | | (cherry picked from commit a853a8ba7850381d49b284295dd6f0dc491dbe44)
* [3.6] bpo-30662: fixed OrderedDict.__init__ docstring re PEP 468 (GH-2179) ↵Mariatta2017-09-061-2/+1
| | | | | | | | | | | | | | (GH-3370) * fixed OrderedDict.__init__ docstring re PEP 468 * tightened comment and mirrored to C impl * added space after period per marco-buttu * preserved substituted for stable * drop references to Python 3.6 and PEP 468 (cherry picked from commit faa57cbe7074b26807cd7ed89a7b173b5cbf3086)
* bpo-31095: fix potential crash during GC (GH-3195)INADA Naoki2017-09-042-0/+9
| | | (cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
* bpo-31161: only check for parens error for SyntaxError (#3083)Martijn Pieters2017-08-221-5/+10
| | | | | Subclasses such as IndentError and TabError should not have this message applied.
* [3.6] bpo-31232: Backport custom print rshift message (GH-3155)Nick Coghlan2017-08-191-0/+15
| | | | | | | | | | | | | bpo-30721 added a "Did you mean ...?" suggestion to rshift TypeError messages that triggers when the LHS is a Python C function called "print". Since this custom error message is expected to be triggered primarily by attempts to use Python 2 print redirection syntax in Python 3, and is incredibly unlikely to be encountered otherwise, it is also being backported to the next 3.6 maintenance release. Initial patch by Sanyam Khurana.
* [3.6] bpo-30978: str.format_map() now passes key lookup exceptions through. ↵Serhiy Storchaka2017-08-031-6/+10
| | | | | | (GH-2790) (#2992) Previously any exception was replaced with a KeyError exception. (cherry picked from commit 5075416)
* [3.6] bpo-22207: Add checks for possible integer overflows in ↵Serhiy Storchaka2017-07-111-6/+12
| | | | | | unicodeobject.c. (GH-2623) (#2658) Based on patch by Victor Stinner. (cherry picked from commit 64e461b)
* [3.6] bpo-30597: Show expected input in custom 'print' error message. (GH-2531)Nick Coghlan2017-07-031-3/+45
| | | (cherry picked from commit 3a7f03584ab75afbf5507970711c87042e423bb4)
* [3.6] bpo-13617: Reject embedded null characters in wchar* strings. ↵Serhiy Storchaka2017-06-281-0/+14
| | | | | | | | | | (GH-2302) (#2462) Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.. (cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
* bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456)Victor Stinner2017-06-281-1/+2
| | | | Free also co_extra->ce_extras, not only co_extra. (cherry picked from commit 23e7944eba1968bb8432fdc4cc96d4fdd2c1a230)
* [3.6] bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). ↵Serhiy Storchaka2017-06-271-0/+31
| | | | | | | (GH-2285) (#2443) Raise a ValueError if the second argument is NULL and the wchar_t\* string contains null characters.. (cherry picked from commit e613e6add5f07ff6aad5802924596b631b707d2a)
* [3.6] bpo-30730: Prevent environment variables injection in subprocess on ↵Serhiy Storchaka2017-06-231-2/+2
| | | | | | Windows. (GH-2325) (#2360) Prevent passing other invalid environment variables and command arguments.. (cherry picked from commit d174d24a5d37d1516b885dc7c82f71ecd5930700)
* [3.6] bpo-30604: Move co_extra_freefuncs to interpreter state to avoid ↵Dino Viehland2017-06-131-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | crashes in threads (#2015) * Move co_extra_freefuncs to interpreter state to avoid crashes in multi-threaded scenarios involving deletion of code objects * Don't require that extra be zero initialized * Build test list instead of defining empty test class * Ensure extra is always assigned on success * Keep the old fields in the thread state object, just don't use them Add new linked list of code extra objects on a per-interpreter basis so that interpreter state size isn't changed * Rename __PyCodeExtraState_Get and add comment about it going away in 3.7 Fix sort order of import's in test_code.py * Remove an extraneous space * Remove docstrings for comments * Touch up formatting * Fix casing of coextra local * Fix casing of another variable * Prefix PyCodeExtraState with __ to match C API for getting it * Update NEWS file for bpo-30604
* bpo-30524: Fix _PyStack_UnpackDict() (#1886)Victor Stinner2017-06-092-11/+11
| | | | | | * bpo-29259: Remove unused func parameter of _PyStack_UnpackDict() * bpo-29286: Change _PyStack_UnpackDict() prototype to be able to notify of failure when args is NULL. _PyStack_UnpackDict() now returns -1 on error.
* [3.6] bpo-27945: Fixed various segfaults with dict. (GH-1657) (#1677)Serhiy Storchaka2017-05-201-25/+44
| | | | Based on patches by Duane Griffin and Tim Mitchell. (cherry picked from commit 753bca3934a7618a4fa96e107ad1c5c18633a683)
* [3.6] bpo-25794: Fix `type.__setattr__()` for non-interned attribute names. ↵Serhiy Storchaka2017-05-201-5/+34
| | | | | | | (GH-1652) (#1673) Based on patch by Eryk Sun. (cherry picked from commit d896985bb2de49046f9b6879e906d1e4db255e23)
* bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) (#1529)Xiang Zhang2017-05-101-3/+5
|
* bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (#1217)Serhiy Storchaka2017-04-201-0/+1
|
* [3.6] bpo-12414: Update code_sizeof() to take in account co_extra memory. ↵Dong-hee Na2017-04-201-3/+7
| | | | (#1168) (#1198)
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() ↵Serhiy Storchaka2017-04-191-3/+9
| | | | | | | (#1096) (#1180) raised an error. (cherry picked from commit bf623ae8843dc30b28c574bec8d29fc14be59d86)
* [3.6] bpo-29549: Fixes docstring for str.index (GH-256) (GH-1028)Mariatta2017-04-092-5/+20
| | | (cherry picked from commit 43ba8861e0ad044efafa46a7cc04e12ac5df640e)
* bpo-29998: Pickling and copying ImportError now preserves name and path ↵Serhiy Storchaka2017-04-081-0/+48
| | | | | | (#1010) (#1042) attributes. (cherry picked from commit b785396ab451b0c9d6ae9ee5a9e56c810209a6cb)
* Expand the PySlice_GetIndicesEx macro. (#1023) (#1044)Serhiy Storchaka2017-04-086-20/+23
| | | (cherry picked from commit b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8)
* bpo-29941: Assert fixes (#886) (#955)T. Wouters2017-04-022-2/+2
| | | | | | | | | | Make a non-Py_DEBUG, asserts-enabled build of CPython possible. This means making sure helper functions are defined when NDEBUG is not defined, not just when Py_DEBUG is defined. Also fix a division-by-zero in obmalloc.c that went unnoticed because in Py_DEBUG mode, elsize is never zero. (cherry picked from commit a00c3fd12d421e41b769debd7df717d17b0deed5 and 06bb4873d6a9ac303701d08a851d6cd9a51e02a3)