| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-94999) (GH-95354)
When keyword argument name is an instance of a str subclass with
overloaded methods __eq__ and __hash__, the former code could not find
the name of an extraneous keyword argument to report an error, and
_PyArg_UnpackKeywords() returned success without setting the
corresponding cell in the linearized arguments array. But since the number
of expected initialized cells is determined as the total number of passed
arguments, this lead to reading NULL as a keyword parameter value, that
caused SystemError or crash or other undesired behavior..
(cherry picked from commit ebad53a4dc1bb591820724a22cef9b8459185b5f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
| |
(GH-94931) (GH-94963)
(cherry picked from commit 067f0da33506f70c36a67d5f3d8d011c8dae10c9)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
| |
It returned 1 (success) when warnings are turned into exceptions.
(cherry picked from commit 107c21c5d56682320b38c01b5575c1604a429239)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
`convertitem()` raises `SystemError` when 'GH-' is used without `PY_SSIZE_T_CLEAN`.
This commit makes `skipitem()` raise it too.
(cherry picked from commit 4ebf4a6bfad4afcbab3baf9c0159c7767e2a64c0)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
| | |
|
| |
|
|
|
| |
Emit DeprecationWarning when PyArg_Parse*() is called with 'u', 'Z' format.
See PEP 623.
|
| |
|
|
|
|
|
|
|
|
|
| |
No longer use deprecated aliases to functions:
* Replace PyMem_MALLOC() with PyMem_Malloc()
* Replace PyMem_REALLOC() with PyMem_Realloc()
* Replace PyMem_FREE() with PyMem_Free()
* Replace PyMem_Del() with PyMem_Free()
* Replace PyMem_DEL() with PyMem_Free()
Modify also the PyMem_DEL() macro to use directly PyMem_Free().
|
| | |
|
| |
|
|
|
|
|
| |
The PY_SSIZE_T_CLEAN macro must now be defined to use
PyArg_ParseTuple() and Py_BuildValue() "#" formats: "es#", "et#",
"s#", "u#", "y#", "z#", "U#" and "Z#". See the PEP 353.
Update _testcapi.test_buildvalue_issue38913().
|
| |
|
|
| |
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
|
|
| |
The PEP 353, written in 2005, introduced PY_FORMAT_SIZE_T. Python no
longer supports macOS 10.4 and Visual Studio 2010, but requires more
recent macOS and Visual Studio versions. In 2020 with Python 3.10, it
is now safe to use directly "%zu" to format size_t and "%zi" to
format Py_ssize_t.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-20443)
Previously, the result could have been an instance of a subclass of int.
Also revert bpo-26202 and make attributes start, stop and step of the range
object having exact type int.
Add private function _PyNumber_Index() which preserves the old behavior
of PyNumber_Index() for performance to use it in the conversion functions
like PyLong_AsLong().
|
| |
|
|
| |
Only __index__ should be used to make integer conversions lossless.
|
| |
|
|
| |
data. (GH-19345)
|
| | |
|
| |
|
| |
Replace direct access to PyObject.ob_type with Py_TYPE().
|
| |
|
|
|
|
|
|
| |
All keywords should first be checked for pointer identity. Only
after that failed for all keywords (unlikely) should unicode
equality be used.
The original code would call unicode equality on any non-matching
keyword argument. Meaning calling it often e.g. when a function
has many kwargs but only the last one is provided.
|
| | |
|
| |
|
|
| |
Windows. (GH-16347)
|
| | |
|
| |
|
|
| |
Argument Clinic. (GH-13593)
|
| | |
|
| |
|
|
|
|
|
|
| |
The fact that keyword names are strings is now part of the vectorcall and `METH_FASTCALL` protocols. The biggest concrete change is that `_PyStack_UnpackDict` now checks that and raises `TypeError` if not.
CC @markshannon @vstinner
https://bugs.python.org/issue37540
|
| |
|
| |
We will remove int support from 3.10 or 4.0.
|
| | |
|
| |
|
|
| |
(GH-12058)
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
available. (GH-11952)
Deprecate using the __int__() method in implicit conversions of Python
numbers to C integers.
|
| |
|
|
| |
(GH-11313)
|
| |
|
|
| |
parameter. (GH-9689)
|
| | |
|
| |
|
|
| |
Move _PyTuple_ITEMS() to a new header file:
Include/internal/pycore_tupleobject.h
|
| |
|
|
|
|
|
| |
* _PyTuple_ITEMS() gives access to the tuple->ob_item field and cast the
first argument to PyTupleObject*. This internal macro is only usable if
Py_BUILD_CORE is defined.
* Replace &PyTuple_GET_ITEM(ob, 0) with _PyTuple_ITEMS(ob).
* Replace PyTuple_GET_ITEM(op, 1) with &_PyTuple_ITEMS(ob)[1].
|
| | |
|
| | |
|
| |
|
| |
Fix typos found by codespell in docs, docstrings, and comments.
|
| |
|
|
| |
arguments. (#4746)
|
| |
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
received. (#3180)
|
| |
|
|
| |
(#3157)
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
* Fix regression in error message introduced in bpo-29951.
* Add test.
* Make the test more strong.
|
| |
|
|
|
|
|
| |
to functions implemented in C that don't support this.
Also unified error messages for functions that don't take positional or keyword
arguments.
|
| |
|
|
|
|
|
| |
`PyArg_ParseTuple*` (#916)
Also changed format specifier for function name from "%s" to "%.200s"
and exception messages should start with lowercase letter.
|
| |
|
|
| |
_PyArg_NoPositional() now are macros.
|