summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45392: Update the docstring of the 'type' built-in (GH-29439) (GH-29453)Miss Islington (bot)2021-11-061-3/+1
| | | | | (cherry picked from commit 91275207296c39e495fe118019a757c4ddefede8) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* bpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048) (GH-29178)Miss Islington (bot)2021-11-041-6/+14
| | | | | | | | * Use Py_EnterRecursiveCall() in issubclass() Reviewed-by: Gregory P. Smith <greg@krypto.org> [Google] (cherry picked from commit 423fa1c1817abfa8c3d1bc308ddbbd8f28b69d68) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* bpo-45467: Fix IncrementalDecoder and StreamReader in the ↵Serhiy Storchaka2021-10-141-20/+44
| | | | | | | | | | "raw-unicode-escape" codec (GH-28944) (GH-28953) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.raw_unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit 39aa98346d5dd8ac591a7cafb467af21c53f1e5d)
* [3.9] bpo-45461: Fix IncrementalDecoder and StreamReader in the ↵Serhiy Storchaka2021-10-141-12/+37
| | | | | | | | | | | | "unicode-escape" codec (GH-28939) (GH-28945) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit c96d1546b11b4c282a7e21737cb1f5d16349656d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.9] Fix typos in the Objects directory (GH-28766) (GH-28795)Christian Clauss2021-10-076-7/+7
| | | | | (cherry picked from commit 5f401f10400123afa9171548c432ea3fc37c0736) Automerge-Triggered-By: GH:JulienPalard
* [3.9] bpo-45385: Fix reference leak from descr_check (GH-28719) (GH-28780)Dong-hee Na2021-10-071-39/+41
| | | | | (cherry picked from commit e6ff4eba6da9b64aed235ba8d730b5645f71955c) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* [3.9] Remove trailing spaces (GH-28710)Serhiy Storchaka2021-10-031-1/+1
|
* [3.9] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28512)Łukasz Langa2021-09-221-1/+1
| | | | | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>. (cherry picked from commit 8f943ca25732d548cf9f0b0393ba8d582fb93e29) Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
* bpo-45167: Fix deepcopying of GenericAlias (GH-28324) (GH-28368)Miss Islington (bot)2021-09-151-0/+2
| | | | | (cherry picked from commit 5dce51a8875d9639786741e962b3cb208596b096) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000)Miss Islington (bot)2021-09-041-16/+18
| | | | | | | It happened with fast range iterator when the calculated stop = start + step * len was out of the C long range. (cherry picked from commit 936f6a16b9ef85bd56b18a247b962801e954c30e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.9] bpo-45083: Include the exception class qualname when formatting an ↵Miss Islington (bot)2021-09-031-0/+8
| | | | | | | | | | | exception (GH-28119) (GH-28135) * bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> (cherry picked from commit b4b6342848ec0459182a992151099252434cc619) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938) (GH-27991)Miss Islington (bot)2021-08-271-1/+1
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 94a3d2a6329ab7941e93ad2f5bcbb8af2b8b80d2) Co-authored-by: chilaxan <chilaxan@gmail.com>
* bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) (GH-27855)Miss Islington (bot)2021-08-201-2/+2
| | | | | (cherry picked from commit 60b93d9e4922eeae25052bc15909d1f4152babde) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* bpo-44698: Restore complex pow behaviour for small integral exponents ↵Miss Islington (bot)2021-08-171-21/+7
| | | | | | | (GH-27772) (GH-27797) (cherry picked from commit 4b9a2dcf19e5d13c3bc2afea2de1f65cd994c699) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* bpo-33930: Fix segfault with deep recursion when cleaning method objects ↵Miss Islington (bot)2021-08-111-1/+5
| | | | | | | (GH-27678) (GH-27720) (cherry picked from commit bfc2d5a5c4550ab3a2fadeb9459b4bd948ff61a2) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-44872: use new trashcan macros in framobject.c (GH-27683) (GH-27691)Irit Katriel2021-08-101-2/+2
|
* bpo-44707: Fix an undefined behavior of the null pointer arithmetic ↵Miss Islington (bot)2021-07-291-2/+9
| | | | | | | (GH-27292) (GH-27443) (cherry picked from commit e5c8ddb1714fb51ab1defa24352c98e0f01205dc) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44657: Fix instancemethod_call to use PyInstanceMethod_GET_FUNCTION ↵Miss Islington (bot)2021-07-281-1/+1
| | | | | | | (GH-27202) (cherry picked from commit ddf8ae31a0f371eff2db14c7f7a45976b86d56ea) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) ↵Miss Islington (bot)2021-07-261-8/+15
| | | | | | | (GH-27367) (cherry picked from commit 1d582bbc969e05896addf97844ddf17ce9830e5e) Co-authored-by: T. Wouters <thomas@python.org>
* bpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ ↵Miss Islington (bot)2021-07-241-0/+6
| | | | | | | (GH-27316) (#27325) (cherry picked from commit 5370f0a82aaa4ba617070d5c71d2b18236096ac0) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* bpo-44184: Fix subtype_dealloc() for freed type (GH-26274)Miss Islington (bot)2021-07-151-2/+9
| | | | | | | | | | | | Fix a crash at Python exit when a deallocator function removes the last strong reference to a heap type. Don't read type memory after calling basedealloc() since basedealloc() can deallocate the type and free its memory. _PyMem_IsPtrFreed() argument is now constant. (cherry picked from commit 615069eb08494d089bf24e43547fbc482ed699b8) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc ↵Miss Islington (bot)2021-07-151-3/+11
| | | | | | | | | | | (GH-27165) (GH-27175) The non-GC-type branch of subtype_dealloc is using the type of an object after freeing in the same unsafe way as GH-26274 fixes. (I believe the old news entry covers this change well enough.) https://bugs.python.org/issue44184 (cherry picked from commit 074e7659f208051b6b973f7fdb654dd22b93aaa2) Co-authored-by: T. Wouters <thomas@python.org>
* [3.9] bpo-44562: Remove invalid PyObject_GC_Del from error path of ↵Ken Jin2021-07-051-4/+4
| | | | types.GenericAlias … (GH-27016) (GH-27028)
* Revert "bpo-44562: Remove invalid PyObject_GC_Del from error path of ↵Pablo Galindo2021-07-041-3/+3
| | | | | types.GenericAlias … (GH-27016) (GH-27018)" (GH-27022) This reverts commit 4684a34c8d2a2ffac7b779edb4ba57f043783478.
* bpo-44562: Remove invalid PyObject_GC_Del from error path of ↵Miss Islington (bot)2021-07-041-3/+3
| | | | | | | | | types.GenericAlias … (GH-27016) (GH-27018) (cherry picked from commit d33943a6c368c2184e238019c63ac7a267da5594) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-44523: Remove the pass-through for hash() in weakref proxy objects ↵Miss Islington (bot)2021-06-291-16/+2
| | | | | | | (GH-26950) (GH-26960) (cherry picked from commit e2fea101fd5517f33371b04432842b971021c3bf) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* Fix a potential reference-counting bug in long_pow (GH-26690) (#26702)Miss Islington (bot)2021-06-131-0/+1
| | | | | | | (cherry picked from commit 59242431991794064824cf2ab70886367613f29e) Co-authored-by: Mark Dickinson <mdickinson@enthought.com> Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* [3.9] bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris ↵Jakub Kulík2021-05-211-0/+40
| | | | | | | (GH-25096) (GH-25847) (cherry picked from commit 9032cf5cb1e33c0349089cfb0f6bf11ed3c30e86) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* bpo-44114: Fix dictkeys_reversed and dictvalues_reversed function signatures ↵Miss Islington (bot)2021-05-161-4/+4
| | | | | | | | | | | | (GH-26062) (GH-26093) These are passed and called as PyCFunction, however they are defined here without the (ignored) args parameter. This works fine in some C compilers, but fails in webassembly or anything else that has strict function pointer call type checking. (cherry picked from commit ab383eb6f03896b0ef6634ee3d776344fcb9e5b8) Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk> Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
* bpo-44114: Remove redundant cast. (GH-26098)Miss Islington (bot)2021-05-131-2/+2
| | | | | (cherry picked from commit e0c614e5fd017ca43cab55a9f8490133750c704f) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* [3.9] bpo-42083: Allow NULL doc in PyStructSequence_NewType (#25896)Petr Viktorin2021-05-041-6/+11
| | | | | (cherry picked from commit 2f5baa17504feb9a7613bac32fdceed4894434de) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-42800: Add audit events for f_code and tb_frame (GH-24182)Steve Dower2021-05-032-7/+9
| | | | | | | | Accessing the following attributes will now fire PEP 578 style audit hooks as (object.__getattr__, obj, name): * PyTracebackObject: tb_frame * PyFrameObject: f_code * PyGenObject: gi_code, gi_frame * PyCoroObject: cr_code, cr_frame * PyAsyncGenObject: ag_code, ag_frame
* bpo-42924: Fix incorrect copy in bytearray_repeat (GH-24208) (#24211)Miss Islington (bot)2021-04-261-2/+4
| | | | | | | Before, using the * operator to repeat a bytearray would copy data from the start of the internal buffer (ob_bytes) and not from the start of the actual data (ob_start). (cherry picked from commit 61d8c54f43a7871d016f98b38f86858817d927d5) Co-authored-by: Tobias Holl <TobiasHoll@users.noreply.github.com>
* bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843)Miss Islington (bot)2021-03-171-4/+5
| | | | | | | | | | | | | Python no longer fails at startup with a fatal error if a command line argument contains an invalid Unicode character. The Py_DecodeLocale() function now escapes byte sequences which would be decoded as Unicode characters outside the [U+0000; U+10ffff] range. Use MAX_UNICODE constant in unicodeobject.c. (cherry picked from commit 9976834f807ea63ca51bc4f89be457d734148682) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.9] bpo-43499: Restrict co_code to be under INT_MAX in codeobject ↵Ammar Askar2021-03-172-1/+11
| | | | | (GH-20628) (GH-24896) (cherry picked from commit 3b3b83c965447a8329b34cb4befe6e9908880ee5)
* bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387) (GH-24894)Miss Islington (bot)2021-03-161-1/+2
| | | | | | | | | | | Fix warning: Objects\exceptions.c(2324,56): warning C4098: 'MemoryError_dealloc': 'void' function returning a value (cherry picked from commit bbeb223e9a5e9f9374df384efa386b4068a65c0e) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-43499: Silence compiler warnings about using legacy C API on Windows ↵Serhiy Storchaka2021-03-161-0/+6
| | | | (GH-24873)
* [3.9] bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999) ↵Miss Islington (bot)2021-01-051-1/+2
| | | | | | | | | | | | | | | | | | | | (GH-24005) ``` In file included from /usr/include/python3.8/Python.h:147: In file included from /usr/include/python3.8/abstract.h:837: /usr/include/python3.8/cpython/abstract.h:91:11: error: cast from 'char *' to 'vectorcallfunc *' (aka 'struct _object *(**)(struct _object *, struct _object *const *, unsigned long, struct _object *)') increases required alignment from 1 to 8 [-Werror,-Wcast-align] ptr = (vectorcallfunc*)(((char *)callable) + offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-Authored-By: Andreas Schneider <asn@cryptomilk.org> Co-Authored-By: Antoine Pitrou <antoine@python.org> (cherry picked from commit 056c08211b402b4dbc1530a9de9d00ad5309909f)
* [3.9] bpo-42425: Fix possible leak in initialization of errmap for OSError ↵Serhiy Storchaka2021-01-021-1/+3
| | | | | | (GH-23446). (GH-24057) (cherry picked from commit ed1007c0d74e658d1e6c9b51b12ce7501eb8cbf9)
* [3.9] bpo-42195: Ensure consistency of Callable's __args__ in ↵kj2020-12-141-21/+39
| | | | | collections.abc and typing (GH-23765) Backport of GH-23060.
* bpo-42536: GC track recycled tuples (GH-23623) (GH-23651)Brandt Bucher2020-12-073-0/+26
| | | | | | | | | | | | | | | | | Several built-in and standard library types now ensure that their internal result tuples are always tracked by the garbage collector: - collections.OrderedDict.items - dict.items - enumerate - functools.reduce - itertools.combinations - itertools.combinations_with_replacement - itertools.permutations - itertools.product - itertools.zip_longest - zip Previously, they could have become untracked by a prior garbage collection. (cherry picked from commit 226a012d1cd61f42ecd3056c554922f359a1a35d)
* bpo-42576: Raise TypeError when passing in keyword arguments to GenericAlias ↵Miss Islington (bot)2020-12-051-1/+1
| | | | | | | | | | | | (GH-23656) Use `_PyArg_NoKeywords` instead of `_PyArg_NoKwnames` when checking the `kwds` tuple when creating `GenericAlias`. This fixes an interpreter crash when passing in keyword arguments to `GenericAlias`'s constructor. Needs backport to 3.9. Automerge-Triggered-By: GH:gvanrossum (cherry picked from commit 804d6893b801e8f30318afc38c20d4d0e6161db3) Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-42412: Fix possible leaks and check arguments in ↵Miss Islington (bot)2020-11-211-5/+18
| | | | | | | | | | | PyType_FromModuleAndSpec() (GH-23410) * There were leaks if Py_tp_bases is used more than once or if some call is failed before setting tp_bases. * There was a crash if the bases argument or the Py_tp_bases slot is not a tuple. * The documentation was not accurate. (cherry picked from commit 1db76394ea79030aa4ed5349c950f6c6da51450f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-40998: Address compiler warnings found by ubsan (GH-20929)Miss Islington (bot)2020-11-181-1/+5
| | | | | | | | Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: GH:tiran (cherry picked from commit 07f2adedf0940b06d136208ec386d69b7d2d5b43) Co-authored-by: Christian Heimes <christian@python.org>
* [3.9] bpo-42332: Add weakref slot to types.GenericAlias (GH-23250) (GH-23309)kj2020-11-171-0/+6
| | | (cherry picked from commit 384b7a4bd988986bca227c7e85c32d766da74708)
* Fix typo in unicodeobject.c (GH-23180)Miss Islington (bot)2020-11-101-1/+1
| | | | | | | | exeeds -> exceeds Automerge-Triggered-By: GH:Mariatta (cherry picked from commit 38811d68caf9b782ea7168479acb09557e126efe) Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
* bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the ↵Miss Skeleton (bot)2020-10-291-13/+16
| | | | | | | | | func object (GH-22953) (GH-23021) func_dealloc() does not handle partially-created objects. Best not to give it any. (cherry picked from commit 350526105fa9b131d8b941ae753378b741dabb2f) Co-authored-by: Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
* bpo-42065: Fix incorrectly formatted _codecs.charmap_decode error message ↵Miss Skeleton (bot)2020-10-181-1/+1
| | | | | | | (GH-19940) (cherry picked from commit 3635388f52b42e5280229104747962117104c453) Co-authored-by: Max Bernstein <tekknolagi@users.noreply.github.com>
* bpo-41984: GC track all user classes (GH-22701/GH-22702)Miss Skeleton (bot)2020-10-151-16/+6
| | | (cherry picked from commit c13b847a6f913b72eeb71651ff626390b738d973)
* bpo-42015: Reorder dereferencing calls in meth_dealloc, to make sure m_self ↵Miss Skeleton (bot)2020-10-121-2/+4
| | | | | | | is kept alive long enough (GH-22670) (cherry picked from commit 04b8631d84a870dda456ef86039c1baf34d08500) Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net>