Commit Graph

5879 Commits

Author SHA1 Message Date
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
INADA Naoki 89ddffbe9d bpo-29438: fixed use-after-free in key sharing dict (#39) 2017-02-13 09:19:05 +09:00
Serhiy Storchaka 512c57cb72 Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher.
2017-01-25 13:25:52 +02:00
Serhiy Storchaka b2a5be0763 Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher.
2017-01-25 13:23:05 +02:00
Serhiy Storchaka 4102d25b7e Issue #29337: Fixed possible BytesWarning when compare the code objects.
Warnings could be emitted at compile time.
2017-01-24 20:52:43 +02:00
Serhiy Storchaka 713640c4c9 Issue #29337: Fixed possible BytesWarning when compare the code objects.
Warnings could be emitted at compile time.
2017-01-24 20:49:26 +02:00
Martin Panter 4659ddc433 Merge doc fixes from 3.5 2017-01-14 09:54:57 +00:00
Martin Panter 536d70ed33 Fix grammar, typos and markup in documentation and code comments
* Indent versionchanged at method level, not class level
* Mark up ``--help`` to avoid generating an en dash
* Use forward slash in Unix command line with a dollar sign ($) prompt
2017-01-14 08:23:08 +00:00
Serhiy Storchaka 42e1ea9a10 Issue #28969: Fixed race condition in C implementation of functools.lru_cache.
KeyError could be raised when cached function with full cache was
simultaneously called from differen threads with the same uncached arguments.
2017-01-12 19:12:21 +02:00
Serhiy Storchaka 67796521dd Issue #28969: Fixed race condition in C implementation of functools.lru_cache.
KeyError could be raised when cached function with full cache was
simultaneously called from differen threads with the same uncached arguments.
2017-01-12 18:34:33 +02:00
Xiang Zhang 95403d74d7 Issue #29145: Merge 3.5. 2017-01-10 10:54:19 +08:00
Xiang Zhang b0541f4cdf Issue #29145: Fix overflow checks in str.replace() and str.join().
Based on patch by Martin Panter.
2017-01-10 10:52:00 +08:00
INADA Naoki a634e23209 Issue #29159: Fix regression in bytes(x) when x.__index__() raises Exception. 2017-01-06 17:32:01 +09:00
Stefan Krah a50006c977 Merge 3.5. 2016-12-30 12:24:23 +01:00
Stefan Krah 195319e6bb Issue #29111: Fix memoryview signature. 2016-12-30 12:23:35 +01:00
Serhiy Storchaka c9ad8b7a23 Issue #29073: bytearray formatting no longer truncates on first null byte. 2016-12-28 09:54:22 +02:00
Antoine Pitrou d741ed492f Issue #28427: old keys should not remove new values from
WeakValueDictionary when collecting from another thread.
2016-12-27 14:23:43 +01:00
Antoine Pitrou e10ca3a0fe Issue #28427: old keys should not remove new values from
WeakValueDictionary when collecting from another thread.
2016-12-27 14:19:20 +01:00
Xiang Zhang 437a5d2c25 Issue #29044: Merge 3.5. 2016-12-22 15:31:22 +08:00
Xiang Zhang ea1cf87030 Issue #29044: Fix a use-after-free in string '%c' formatter. 2016-12-22 15:30:47 +08:00
INADA Naoki 6165d55f13 Issue #28147: Fix a memory leak in split-table dictionaries
setattr() must not convert combined table into split table.
2016-12-20 09:54:24 +09:00
Serhiy Storchaka 025f8953f1 Issue #29000: Fixed bytes formatting of octals with zero padding in alternate
form.
2016-12-17 22:13:05 +02:00
Serhiy Storchaka b1a1619bf0 Issue #29000: Fixed bytes formatting of octals with zero padding in alternate
form.
2016-12-17 21:48:03 +02:00
Xavier de Gaye 76febd0792 Issue #26919: On Android, operating system data is now always encoded/decoded
to/from UTF-8, instead of the locale encoding to avoid inconsistencies with
os.fsencode() and os.fsdecode() which are already using UTF-8.
2016-12-15 20:59:58 +01:00
Victor Stinner 3d3f264849 Fix a memory leak in split-table dictionaries
Issue #28147: Fix a memory leak in split-table dictionaries: setattr() must not
convert combined table into split table.

Patch written by INADA Naoki.
2016-12-15 17:21:23 +01:00
Serhiy Storchaka 386072ebe0 Merge from 3.6. 2016-12-14 19:54:38 +02:00
Serhiy Storchaka 49010ee323 Revert changeset 1f31bf3f76f5 (issue5322) except tests. 2016-12-14 19:52:17 +02:00