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.
9 years ago
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.
9 years ago
Raymond Hettinger
64e2f9ac86
Issue #27100 : Fix ref leak
9 years ago
Raymond Hettinger
a3fec1543d
Issue #27100 : With statement reports missing __enter__ before __exit__. (Contributed by Jonathan Ellington.)
9 years ago
Serhiy Storchaka
06515833fe
Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
9 years ago
Serhiy Storchaka
144f77a981
Issue #28715 : Added error checks for PyUnicode_AsUTF8().
9 years ago
Xavier de Gaye
ec5d3cd533
Issue #28746 : Fix the set_inheritable() file descriptor method on platforms
that do not have the ioctl FIOCLEX and FIONCLEX commands
9 years ago
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.
9 years ago
Serhiy Storchaka
f4934ea77d
Issue #28701 : Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
9 years ago
Xavier de Gaye
b445ad7b04
Issue #26920 : Fix not getting the locale's charset upon initializing the interpreter,
on platforms that do not have langinfo
9 years ago
Victor Stinner
f9cca365c7
Fix warn_invalid_escape_sequence()
Issue #28691 : Fix warn_invalid_escape_sequence(): handle correctly
DeprecationWarning raised as an exception. First clear the current exception to
replace the DeprecationWarning exception with a SyntaxError exception.
Unit test written by Serhiy Storchaka.
9 years ago
Ned Deily
7ae4112649
Issue #28676 : Prevent missing 'getentropy' declaration warning on macOS.
Patch by Gareth Rees.
9 years ago
Raymond Hettinger
13527123a1
Issue #28665 : Harmonize STORE_DEREF with STORE_FAST and LOAD_DEREF giving a 40% speedup.
9 years ago
Yury Selivanov
1a9d687a49
Issue #26182 : Fix ia refleak in code that raises DeprecationWarning.
9 years ago
Serhiy Storchaka
70b72f0f96
Fixed possible abort in ceval loop if _PyUnicode_FromId() fails.
Every opcode should end with DISPATCH() or goto error.
9 years ago
Yury Selivanov
2edd8a1e2c
Issue #27243 : Change PendingDeprecationWarning -> DeprecationWarning.
As it was agreed in the issue, __aiter__ returning an awaitable
should result in PendingDeprecationWarning in 3.5 and in
DeprecationWarning in 3.6.
9 years ago
Eric V. Smith
9b88fdf4f0
Fixed issue #28633 : segfault when concatenating bytes literal and f-string.
9 years ago
Ned Deily
da4887a88d
Issue #28616 : Correct help for sys.version_info releaselevel component.
Patch by Anish Tambe.
9 years ago
Eric V. Smith
5646648678
Issue 28128: Print out better error/warning messages for invalid string escapes. Backport to 3.6.
9 years ago
Serhiy Storchaka
7db3c48833
Issue #28517 : Fixed of-by-one error in the peephole optimizer that caused
keeping unreachable code.
9 years ago
Serhiy Storchaka
467ab194fc
Issue #28410 : Added _PyErr_FormatFromCause() -- the helper for raising
new exception with setting current exception as __cause__.
_PyErr_FormatFromCause(exception, format, args...) is equivalent to Python
raise exception(format % args) from sys.exc_info()[1]
9 years ago
Serhiy Storchaka
9e373be1bc
Issue #28410 : Keep the traceback of original exception in _PyErr_ChainExceptions().
9 years ago
Benjamin Peterson
4510e6de9d
mark dtrace stubs as static inline; remove stubs
C99 inline semantics don't work everywhere. (https://bugs.python.org/issue28092 )
We don't want these to have external visibility anyway.
9 years ago
Serhiy Storchaka
04eb777279
Issue #23782 : Fixed possible memory leak in _PyTraceback_Add() and exception
loss in PyTraceBack_Here().
9 years ago
Serhiy Storchaka
5665301bae
Issue #28257 : Improved error message when pass a non-mapping as a var-keyword
argument.
9 years ago
Serhiy Storchaka
cf3806026b
Issue #24098 : Fixed possible crash when AST is changed in process of
compiling it.
9 years ago
Berker Peksag
8e9045d0d8
Issue #27358 : Fix typo in error message
9 years ago
Serhiy Storchaka
e036ef8fa2
Issue #27358 : Optimized merging var-keyword arguments and improved error
message when pass a non-mapping as a var-keyword argument.
9 years ago
Serhiy Storchaka
7344285c19
Issue #28257 : Improved error message when pass a non-iterable as
a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
9 years ago
Serhiy Storchaka
00a0fc1144
Issue #27942 : String constants now interned recursively in tuples and frozensets.
9 years ago
Alexander Belopolsky
3e7a3cb903
Issue #28148 : Stop using localtime() and gmtime() in the time module.
Introduced platform independent _PyTime_localtime API that is similar
to POSIX localtime_r, but available on all platforms. Patch by Ed
Schouten.
9 years ago
Christian Heimes
517507c6d5
Issue #28100 : Refactor error messages, patch by Ivan Levkivskyi
9 years ago
Serhiy Storchaka
208bbd29d3
Silence GCC warning.
The code was correct, but GCC is not enough clever.
9 years ago
Serhiy Storchaka
63dc548109
Issue #28086 : Single var-positional argument of tuple subtype was passed
unscathed to the C-defined function. Now it is converted to exact tuple.
9 years ago
Christian Heimes
2f2fee19ec
va_end() all va_copy()ed va_lists.
9 years ago
Benjamin Peterson
0c21214f3e
replace usage of Py_VA_COPY with the (C99) standard va_copy
9 years ago
Victor Stinner
6d8bc46cc0
Catch EPERM error in py_getrandom()
Issue #27955 : Fallback on reading /dev/urandom device when the getrandom()
syscall fails with EPERM, for example when blocked by SECCOMP.
9 years ago
Victor Stinner
af59732102
Cleanup random.c
Issue #27955 : modify py_getrnadom() and dev_urandom()
* Add comments from Python 3.7
* PEP 7 style: add {...}
9 years ago
Benjamin Peterson
286987bbac
delete dead code
9 years ago
Steve Dower
74f4af7ac3
Issue #27932 : Prevent memory leak in win32_ver().
9 years ago
Steve Dower
1ec262be80
Issue #27932 : Prevent memory leak in win32_ver().
9 years ago
Yury Selivanov
8987c9d219
Issue #26182 : Raise DeprecationWarning for improper use of async/await keywords
9 years ago
Benjamin Peterson
59e5e0dca2
improve type-safe of and prevent double-frees in get_locale_info ( #28119 )
9 years ago
Christian Heimes
f051e43b22
Issue #28126 : Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
9 years ago
Victor Stinner
57f91ac95a
Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict()
Issue #27213 .
9 years ago
Victor Stinner
eece2229e2
Issue #27213 : Fix reference leaks
9 years ago
Eric V. Smith
09835dcdbb
Make an f-string error message more exact and consistent.
9 years ago
Serhiy Storchaka
b72810583e
Issue #27213 : Fixed different issues with reworked CALL_FUNCTION* opcodes.
* BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK_WITH_CALL no longer generated with
single tuple or dict.
* Restored more informative error messages for incorrect var-positional and
var-keyword arguments.
* Removed code duplications in _PyEval_EvalCodeWithName().
* Removed redundant runtime checks and parameters in _PyStack_AsDict().
* Added a workaround and enabled previously disabled test in test_traceback.
* Removed dead code from the dis module.
9 years ago
Guido van Rossum
015d874626
Issue #28076 : Variable annotations should be mangled for private names.
By Ivan Levkivskyi.
9 years ago
Serhiy Storchaka
a1e9ab34a9
Fixed refactoring bug in dd046963bd42 (issue27129).
9 years ago