Commit Graph

5844 Commits

Author SHA1 Message Date
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
Martin Panter 186b204997 Fix typos in comment and documentation 2016-12-10 05:32:55 +00:00
Serhiy Storchaka 5adfac2c1b Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code.
Original patch by Andreas Stührk.
2016-12-02 08:42:43 +02:00
Serhiy Storchaka 419967b832 Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 2016-12-06 00:13:34 +02:00
INADA Naoki 2c5a830f2a Issue #28731: Optimize _PyDict_NewPresized() to create correct size dict.
Improve speed of dict literal with constant keys up to 30%.
2016-12-07 18:34:44 +09:00
Serhiy Storchaka 0c78634d78 Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code.
Original patch by Andreas Stührk.
2016-12-07 11:26:49 +02:00
Serhiy Storchaka 9a953dbb34 Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 2016-12-06 00:17:45 +02:00
Nick Coghlan 19d246745d Issue #23722: improve __classcell__ compatibility
Handling zero-argument super() in __init_subclass__ and
__set_name__ involved moving __class__ initialisation to
type.__new__. This requires cooperation from custom
metaclasses to ensure that the new __classcell__ entry
is passed along appropriately.

The initial implementation of that change resulted in abruptly
broken zero-argument super() support in metaclasses that didn't
adhere to the new requirements (such as Django's metaclass for
Model definitions).

The updated approach adopted here instead emits a deprecation
warning for those cases, and makes them work the same way they
did in Python 3.5.

This patch also improves the related class machinery documentation
to cover these details and to include more reader-friendly
cross-references and index entries.
2016-12-05 16:47:55 +10:00
Serhiy Storchaka 9ec07721f4 Issue #28797: Modifying the class __dict__ inside the __set_name__ method of
a descriptor that is used inside that class no longer prevents calling the
 __set_name__ method of other descriptors.
2016-11-29 09:54:17 +02:00
Victor Stinner f7d199ff32 Fix _PyGen_yf()
Issue #28782: Fix a bug in the implementation ``yield from`` when checking
if the next instruction is YIELD_FROM. Regression introduced by WORDCODE
(issue #26647).

Reviewed by Serhiy Storchaka and Yury Selivanov.
2016-11-24 22:33:01 +01:00
Serhiy Storchaka ac0720eaa4 Issue #28760: Clean up and fix comments in PyUnicode_AsUnicodeEscapeString().
Patch by Xiang Zhang.
2016-11-21 11:46:51 +02:00
Serhiy Storchaka 06515833fe Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
2016-11-20 09:13:07 +02:00
Yury Selivanov 41782e4970 Issue #28721: Fix asynchronous generators aclose() and athrow() 2016-11-16 18:16:17 -05:00
Serhiy Storchaka a83a6a3275 Issue #28701: _PyUnicode_EqualToASCIIId and _PyUnicode_EqualToASCIIString now
require ASCII right argument and assert this condition in debug build.
2016-11-16 20:02:44 +02:00
Serhiy Storchaka df66b9c425 Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701). 2016-11-16 16:12:56 +02:00
Serhiy Storchaka 292dd1b2ad Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701). 2016-11-16 16:12:34 +02:00
Serhiy Storchaka dddec81b2d Issue #21449: Removed private function _PyUnicode_CompareWithId. 2016-11-16 15:56:27 +02:00
Serhiy Storchaka fab6acd9f5 Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.
The latter function is more readable, faster and doesn't raise exceptions.

Based on patch by Xiang Zhang.
2016-11-16 15:41:11 +02:00
Serhiy Storchaka f5894dd646 Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.
The latter function is more readable, faster and doesn't raise exceptions.

Based on patch by Xiang Zhang.
2016-11-16 15:40:39 +02:00
Serhiy Storchaka 3b73ea1278 Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
2016-11-16 10:19:20 +02:00
Serhiy Storchaka f4934ea77d Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
2016-11-16 10:17:58 +02:00
Serhiy Storchaka babe4f8e5e Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
when decode astral characters.
2016-11-12 14:36:02 +02:00
Serhiy Storchaka 6b4b6e956e Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
when decode astral characters.
2016-11-12 14:35:46 +02:00
Serhiy Storchaka 84293aff9f Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
when decode astral characters.
2016-11-12 14:29:48 +02:00
Serhiy Storchaka b626643734 Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
when decode astral characters.
2016-11-12 14:28:06 +02:00
Yury Selivanov 6c10650617 Merge 3.5 (issue #27942) 2016-11-09 09:43:08 -05:00
Yury Selivanov d2fd3599ab ssue #27942: Fix memory leak in codeobject.c 2016-11-09 09:42:14 -05:00
Yury Selivanov 29310c47a7 Issue #28003: Make WrappedVal, ASend and AThrow GC types 2016-11-08 19:46:22 -05:00
Yury Selivanov 49ffdf6bb2 Merge 3.5 2016-11-08 19:19:52 -05:00
Yury Selivanov 33499b7eed genobject: Remove unnecessary tp_free slots from aiter_wrapper and coro_wrapper 2016-11-08 19:19:28 -05:00
Steve Dower 78057b4159 Closes #27781: Removes special cases for the experimental aspect of PEP 529 2016-11-06 19:35:08 -08:00
Benjamin Peterson 3bd7900155 merge 3.5 2016-11-06 13:01:15 -08:00
Benjamin Peterson db87c99444 make sure dict view types are initialized 2016-11-06 13:01:07 -08:00
Serhiy Storchaka 60e49aa756 Issue #23996: Added _PyGen_SetStopIterationValue for safe raising
StopIteration with value. More safely handle non-normalized exceptions
in -_PyGen_FetchStopIterationValue.
2016-11-06 18:47:03 +02:00
Serhiy Storchaka 24411f8a8d Issue #23996: Added _PyGen_SetStopIterationValue for safe raising
StopIteration with value. More safely handle non-normalized exceptions
in -_PyGen_FetchStopIterationValue.
2016-11-06 18:44:42 +02:00
Serhiy Storchaka f0b311bd73 Issue #28123: _PyDict_GetItem_KnownHash() now can raise an exception as
PyDict_GetItemWithError().  Patch by Xiang Zhang.
2016-11-06 13:18:24 +02:00