Serhiy Storchaka
64e461be09
bpo-22207: Add checks for possible integer overflows in unicodeobject.c. ( #2623 )
Based on patch by Victor Stinner.
9 years ago
Sylvain
9648088e6c
bpo-30878: Fix error message when keyword arguments are passed ( #2635 )
to staticmethod() and classmethod().
9 years ago
Serhiy Storchaka
378ebb6578
bpo-30789: Use a single memory block for co_extra. ( #2555 )
* bpo-30789: Use a single memory block for co_extra.
* Address review comments.
9 years ago
Serhiy Storchaka
6969eaf468
bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make ( #1955 )
the bare METH_FASTCALL be used for functions with positional-only
parameters.
9 years ago
Serhiy Storchaka
f7eae0adfc
[security] bpo-13617: Reject embedded null characters in wchar* strings. ( #2302 )
Based on patch by Victor Stinner.
Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters.
9 years ago
Victor Stinner
23e7944eba
bpo-30704, bpo-30604: Fix memleak in code_dealloc() ( #2455 )
Free also co_extra->ce_extras, not only co_extra.
9 years ago
Serhiy Storchaka
e613e6add5
bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). ( #2285 )
Raise a ValueError if the second argument is NULL and the wchar_t\*
string contains null characters.
9 years ago
INADA Naoki
870c286e27
bp-29304: Simplify dictobject.c (GH-2347)
replace `(i << 2) + 1` with `i*5`
9 years ago
Serhiy Storchaka
d174d24a5d
bpo-30730: Prevent environment variables injection in subprocess on Windows. ( #2325 )
Prevent passing other invalid environment variables and command arguments.
9 years ago
INADA Naoki
073ae487b3
bpo-29304: simplify lookdict_index() function. (GH-2273)
9 years ago
Benjamin Peterson
279a96206f
bpo-30736: upgrade to Unicode 10.0 ( #2344 )
Straightforward. While we're at it, though, strip trailing whitespace from generated tables.
9 years ago
Dino Viehland
f3cffd2b78
bpo-30604: clean up co_extra support ( #2144 )
bpo-30604: port fix from 3.6 dropping binary compatibility tweaks
9 years ago
Sanyam Khurana
3a7f03584a
bpo-30597: Show expected input in custom 'print' error message. ( #2009 )
9 years ago
Sylvain
7445381c60
bpo-30600: Fix error messages (condition order in Argument Clinic) ( #2051 )
The function '_PyArg_ParseStack()' and
'_PyArg_UnpackStack' were failing (with error
"XXX() takes Y argument (Z given)") before
the function '_PyArg_NoStackKeywords()' was called.
Thus, the latter did not raise its more meaningful
error : "XXX() takes no keyword arguments".
9 years ago
Lisa Roach
64505a1f6c
bpo-30486: Allow setting cell value ( #1840 )
The cell_contents attribute of the cell object is now writable.
9 years ago
Serhiy Storchaka
6cca5c8459
bpo-30592: Fixed error messages for some builtins. ( #1996 )
Error messages when pass keyword arguments to some builtins that
don't support keyword arguments contained double parenthesis: "()()".
The regression was introduced by bpo-30534.
9 years ago
Serhiy Storchaka
5eb788bf7f
bpo-30534: Fixed error messages when pass keyword arguments ( #1901 )
to functions implemented in C that don't support this.
Also unified error messages for functions that don't take positional or keyword
arguments.
9 years ago
Serhiy Storchaka
4e624ca50a
bpo-30509: Clean up calling type slots. ( #1883 )
Also speed up slot_sq_item.
9 years ago
Serhiy Storchaka
753bca3934
bpo-27945: Fixed various segfaults with dict. ( #1657 )
Based on patches by Duane Griffin and Tim Mitchell.
9 years ago
Serhiy Storchaka
d896985bb2
bpo-25794: Fix `type.__setattr__()` for non-interned attribute names. ( #1652 )
Based on patch by Eryk Sun.
9 years ago
Serhiy Storchaka
7e19dbc92e
bpo-28974: `object.__format__(x, '')` is now equivalent to `str(x)` ( #506 )
rather than `format(str(self), '')`.
9 years ago
Xiang Zhang
a66f9c6bb1
bpo-30341: Improve _PyTrash_thread_destroy_chain() a little bit ( #1545 )
* add a comment about why we need to increase trash_delete_nesting
* move increase and decrese outside of the loop
9 years ago
Xiang Zhang
2ddf5a19c3
bpo-30281: Fix the default value for stop in PySlice_Unpack() ( #1480 )
9 years ago
Serhiy Storchaka
1a5856bf92
bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. ( #751 )
9 years ago
Serhiy Storchaka
40db90c1ce
bpo-29802: Fix reference counting in module-level struct functions ( #1213 )
when pass arguments of wrong type.
9 years ago
Dong-hee Na
b4dc6af7a7
bpo-12414: Update code_sizeof() to take in account co_extra memory. ( #1168 )
9 years ago
Serhiy Storchaka
bf623ae884
bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() ( #1096 )
raised an error.
Replace them with using concrete types API that never fails if appropriate.
9 years ago
Xiang Zhang
8e1ddbd592
fix a refleak in slot_sq_length ( #1162 )
9 years ago
Serhiy Storchaka
55fe1ae970
bpo-30022: Get rid of using EnvironmentError and IOError (except test… ( #1051 )
9 years ago
Serhiy Storchaka
baf9f29811
bpo-29839: Raise ValueError rather than OverflowError in len() for negative values. ( #701 )
9 years ago
Serhiy Storchaka
813f943c59
bpo-29838: Add asserts for checking results of sq_length and mq_length slots. ( #700 )
Negative result should be returned only when an error is set.
9 years ago
Serhiy Storchaka
b785396ab4
bpo-29998: Pickling and copying ImportError now preserves name and path ( #1010 )
attributes.
9 years ago
Serhiy Storchaka
b879fe82e7
Expand the PySlice_GetIndicesEx macro. ( #1023 )
9 years ago
Serhiy Storchaka
205e00c5cf
bpo-29914: Fix default implementations of __reduce__ and __reduce_ex__(). ( #843 )
object.__reduce__() no longer takes arguments, object.__reduce_ex__() now
requires one argument.
9 years ago
Serhiy Storchaka
bae6881b42
Update Argument Clinic generated code for bpo-29878. ( #1001 )
9 years ago
Lisa Roach
43ba8861e0
bpo-29549: Fixes docstring for str.index ( #256 )
* Updates B.index documentation.
* Updates str.index documentation, makes it Argument Clinic compatible.
* Removes ArgumentClinic code.
* Finishes string.index documentation.
* Updates string.rindex documentation.
* Documents B.rindex.
9 years ago
INADA Naoki
e82cf8675b
bpo-29949: Fix set memory usage regression (GH-943)
Revert "Minor factoring: move redundant resize scaling logic into the resize function."
This reverts commit 4897300276 .
9 years ago
T. Wouters
06bb4873d6
Fix spurious MemoryError introduced by PR #886 . ( #930 )
Fix MemoryError caused by moving around code in PR #886 ; nbytes was sometimes used unitinitalized (in non-debug builds, when use_calloc was false and elsize was 0).
9 years ago
T. Wouters
a00c3fd12d
bpo-29941: Assert fixes ( #886 )
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.
9 years ago
Serhiy Storchaka
d4edfc9abf
bpo-29935: Fixed error messages in the index() method of tuple, list and deque ( #887 )
when pass indices of wrong type.
9 years ago
Serhiy Storchaka
918403cfc3
bpo-29816: Shift operation now has less opportunity to raise OverflowError. ( #680 )
ValueError always is raised rather than OverflowError for negative counts.
Shifting zero with non-negative count always returns zero.
9 years ago
Serhiy Storchaka
0a58f72762
bpo-24821: Fixed the slowing down to 25 times in the searching of some ( #505 )
unlucky Unicode characters.
9 years ago
Serhiy Storchaka
ba85d69a3e
bpo-29878: Add global instances of int for 0 and 1. ( #852 )
9 years ago
Louie Lu
c431854a09
bpo-29927: Remove duplicate BufferError init and unnecessary semicolons (GH-866)
9 years ago
Sylvain
d67a103702
bpo-29924: Remove useless argument ( #854 )
9 years ago
Serhiy Storchaka
671079ef60
bpo-29894: Deprecate returning an instance of complex subclass from __complex__. ( #798 )
In a future versions of Python this can be an error.
9 years ago
Serhiy Storchaka
fff9a31a91
bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. ( #748 )
9 years ago
Serhiy Storchaka
c61ac1642d
Don't use Py_SIZE for dict object. ( #747 )
9 years ago
4kir4
e46fb86118
bpo-28876: bool of large range raises OverflowError ( #699 )
9 years ago
Serhiy Storchaka
6b5a9ec478
bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. ( #709 )
9 years ago