Commit Graph

5905 Commits

Author SHA1 Message Date
Miss Islington (bot) 58cbae2293 bpo-16055: Fixes incorrect error text for int('1', base=1000) (GH-4376) (#4389)
(cherry picked from commit 28b624825e)
2017-11-14 01:35:13 -08:00
Miss Islington (bot) ece5659565 bpo-31626: Fixed a bug in debug memory allocator. (GH-3844) (#4191)
Removed a code that incorrectly detected in-place resizing in realloc()
 and wrote to freed memory.
(cherry picked from commit b484d5606c)
2017-10-31 15:58:33 +02:00
Serhiy Storchaka 9ea5a3a45b
[3.6] bpo-20047: Make bytearray methods partition() and rpartition() rejecting (GH-4158) (#4162)
separators that are not bytes-like objects..
(cherry picked from commit a2314283ff)
2017-10-29 12:24:45 +02:00
xdegaye 4b27d51222 [3.6] bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327). (#4135)
(cherry picked from commit 56d1f5ca32)
2017-10-26 17:48:48 +02:00
Miss Islington (bot) 1e78ed6825 bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (GH-4058) (#4059)
and in codecs.escape_decode() when decode an escaped non-ascii byte.
(cherry picked from commit 56cb465cc9)
2017-10-20 17:41:29 +03:00
Miss Islington (bot) cae6e4775b [3.6] bpo-31655: Validate keyword names in SimpleNamespace constructor. (GH-3909) (#3920)
(cherry picked from commit 79ba471488)
2017-10-07 23:52:57 +03:00
Miss Islington (bot) b5a630f3dd [3.6] bpo-31619: Fixed a ValueError when convert a string with large number of underscores (GH-3827) (#3863)
to integer with binary base.
(cherry picked from commit 85c0b8941f)
2017-10-03 15:38:46 +03:00
Serhiy Storchaka f0db2dfda7 [3.6] bpo-31492: Fix assertion failures in case of a module with a bad __name__ attribute. (GH-3620). (#3773)
(cherry picked from commit 6db7033192)
2017-09-27 07:33:00 +03:00
Serhiy Storchaka d6a356209a [3.6] bpo-31579: Fixed a possible leak in enumerate() with large indices. (GH-3753). (#3760)
(cherry picked from commit 0e950dd22b)
2017-09-26 09:11:34 +03:00
Victor Stinner c0e77364ca [3.6] bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0 (#3518)
* bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142)

(cherry picked from commit d73a960c57)

* bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. (#3157)

(cherry picked from commit f432a3234f)

* bpo-31275: Small refactoring to silence a fall-through warning. (#3206)

(cherry picked from commit 138753c1b9)
2017-09-12 16:09:44 -07:00
Benjamin Peterson cb356c2ecc [3.6] bpo-31373: remove overly strict float range checks (GH-3486) (#3495)
This undoes a853a8ba78 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 2bb69a5b4e)
2017-09-11 23:08:49 -07:00
Henk-Jaap Wagenaar 2a0f7c34c3 Backport docstring improvements to OrderedDict. (GH-3470) 2017-09-10 18:11:18 -07:00
Serhiy Storchaka ddb536ba7b [3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). (#3453)
(cherry picked from commit e3b2b4b8d9)
2017-09-08 10:43:54 +03:00
Miss Islington (bot) b03623227e [3.6] fixes bpo-31373: fix undefined floating-point demotions (GH-3396) (#3424)
(cherry picked from commit a853a8ba78)
2017-09-07 11:35:03 -07:00
Mariatta 3b9d4444fe [3.6] bpo-30662: fixed OrderedDict.__init__ docstring re PEP 468 (GH-2179) (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 faa57cbe70)
2017-09-05 18:13:07 -07:00
INADA Naoki 2eea952b1b bpo-31095: fix potential crash during GC (GH-3195)
(cherry picked from commit a6296d34a4)
2017-09-04 12:31:09 +09:00
Martijn Pieters 680f04a926 bpo-31161: only check for parens error for SyntaxError (#3083)
Subclasses such as IndentError and TabError should not have this message
applied.
2017-08-22 13:11:09 -07:00
Nick Coghlan 1a05e87ec7 [3.6] bpo-31232: Backport custom print rshift message (GH-3155)
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.
2017-08-19 16:59:38 +10:00
Serhiy Storchaka f08b2be441 [3.6] bpo-30978: str.format_map() now passes key lookup exceptions through. (GH-2790) (#2992)
Previously any exception was replaced with a KeyError exception.
(cherry picked from commit 5075416)
2017-08-03 12:14:07 +03:00
Serhiy Storchaka 82a9075600 [3.6] bpo-22207: Add checks for possible integer overflows in unicodeobject.c. (GH-2623) (#2658)
Based on patch by Victor Stinner.
(cherry picked from commit 64e461b)
2017-07-11 07:27:56 +03:00
Nick Coghlan bfdc6fdc0e [3.6] bpo-30597: Show expected input in custom 'print' error message. (GH-2531)
(cherry picked from commit 3a7f03584a)
2017-07-03 17:49:50 +10:00
Serhiy Storchaka 0834905d9b [3.6] bpo-13617: Reject embedded null characters in wchar* strings. (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 f7eae0adfc)
2017-06-28 09:27:35 +03:00
Victor Stinner 26daad4ee1 bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456)
Free also co_extra->ce_extras, not only co_extra.
(cherry picked from commit 23e7944eba)
2017-06-28 02:28:51 +02:00
Serhiy Storchaka 0edffa3073 [3.6] bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (GH-2285) (#2443)
Raise a ValueError if the second argument is NULL and the wchar_t\*
string contains null characters..
(cherry picked from commit e613e6add5)
2017-06-27 21:08:58 +03:00
Serhiy Storchaka e7135751b8 [3.6] bpo-30730: Prevent environment variables injection in subprocess on Windows. (GH-2325) (#2360)
Prevent passing other invalid environment variables and command arguments..
(cherry picked from commit d174d24a5d)
2017-06-23 20:17:38 +03:00
Dino Viehland 2997fec01e [3.6] bpo-30604: Move co_extra_freefuncs to interpreter state to avoid 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
2017-06-12 21:46:35 -04:00
Victor Stinner f0ff849adc bpo-30524: Fix _PyStack_UnpackDict() (#1886)
* 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.
2017-06-09 13:24:53 +02:00
Serhiy Storchaka 564398af6c [3.6] bpo-27945: Fixed various segfaults with dict. (GH-1657) (#1677)
Based on patches by Duane Griffin and Tim Mitchell.
(cherry picked from commit 753bca3934)
2017-05-20 13:06:26 +03:00
Serhiy Storchaka 193f7e094f [3.6] bpo-25794: Fix `type.__setattr__()` for non-interned attribute names. (GH-1652) (#1673)
Based on patch by Eryk Sun.
(cherry picked from commit d896985bb2)
2017-05-20 10:23:31 +03:00
Xiang Zhang 98b49a00d4 bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) (#1529) 2017-05-10 19:00:15 +08:00
Serhiy Storchaka 7a113a0cbf bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (#1217) 2017-04-20 22:55:06 +03:00
Dong-hee Na df5df13fdc [3.6] bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168) (#1198) 2017-04-20 11:26:25 +03:00
Serhiy Storchaka 680fea4067 bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096) (#1180)
raised an error.

(cherry picked from commit bf623ae884)
2017-04-19 21:22:49 +03:00
Mariatta 577fc04a71 [3.6] bpo-29549: Fixes docstring for str.index (GH-256) (GH-1028)
(cherry picked from commit 43ba8861e0)
2017-04-09 15:17:06 -07:00
Serhiy Storchaka af685f9050 bpo-29998: Pickling and copying ImportError now preserves name and path (#1010) (#1042)
attributes.
(cherry picked from commit b785396ab4)
2017-04-08 11:25:47 +03:00
Serhiy Storchaka c26b19d5c7 Expand the PySlice_GetIndicesEx macro. (#1023) (#1044)
(cherry picked from commit b879fe82e7)
2017-04-08 11:18:14 +03:00
T. Wouters 90e3518225 bpo-29941: Assert fixes (#886) (#955)
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 a00c3fd12d and 06bb4873d6)
2017-04-01 20:20:05 -07:00
INADA Naoki efde51ad54 bpo-29949: Fix set memory usage regression (GH-945)
Revert "Minor factoring:  move redundant resize scaling logic into the resize function."

This reverts commit 4897300276.
(cherry picked from commit e82cf8675b)
2017-04-01 23:29:31 +09:00
Mariatta 0a17e58446 bpo-28810: Update lnotab_notes.txt (GH-665) (GH-919)
(cherry picked from commit 9135275cba)
2017-03-31 02:12:18 -07:00
Serhiy Storchaka bf4bb2e430 bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) (#907)
when pass indices of wrong type.
(cherry picked from commit d4edfc9abf)
2017-03-30 19:46:59 +03:00
Serhiy Storchaka af839fe2fe bpo-29864: Don't use Py_SIZE for dict object. (#747) (#750) 2017-03-22 07:45:23 +02:00
Serhiy Storchaka 6fad4090ec bpo-28876: bool of large range raises OverflowError (#699) (#734)
(cherry picked from commit e46fb86118)
2017-03-20 09:13:47 +02:00
Serhiy Storchaka 3d258b1eb4 bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. (#709) (#723)
(cherry picked from commit 6b5a9ec478)
2017-03-19 21:06:29 +02:00
Xiang Zhang faa2cc63e4 bpo-28856: Let %b format for bytes support objects that follow the buffer protocol (GH-664) 2017-03-14 15:27:01 +08:00
Yury Selivanov fa448de97d Fix wrapping into StopIteration of return values in generators and coroutines (#644) (#647) 2017-03-12 17:04:06 -04:00
Xiang Zhang df6d7b406f [3.6] bpo-29714: Fix a regression that bytes format may fail when containing zero bytes inside. (GH-504) 2017-03-06 18:17:10 +08:00
Brian Coleman a6e84933d2 bpo-29683 - Fixes to _PyCode_SetExtra when co_extra->ce->extras is (#402)
allocated.

On PyMem_Realloc failure, _PyCode_SetExtra should free co_extra if
co_extra->ce_extras could not be allocated.
On PyMem_Realloc success, _PyCode_SetExtra should set all unused slots in
co_extra->ce_extras to NULL.
2017-03-03 00:21:53 +02:00
Mark Dickinson d9b3cdd137 bpo-29602: fix signed zero handling in complex constructor. (#203) (#206)
* Fix incorrect handling of signed zeros for complex-related classes.

* Add Misc/NEWS entry.

(cherry picked from commit 112ec38c15)
2017-02-20 21:59:30 +00:00
INADA Naoki ce552e2d5c bpo-24274: fix erroneous comment in dictobject.c (GH-200)
lookdict_unicode() and lookdict_unicode_nodummy() may raise exception
when key is not unicode.
2017-02-20 22:58:11 +09:00
Xiang Zhang 9a4577a4bb bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects (#128) (#186) 2017-02-20 14:33:02 +08:00