| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
(GH-27292) (GH-27443)
(cherry picked from commit e5c8ddb1714fb51ab1defa24352c98e0f01205dc)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
(GH-27202)
(cherry picked from commit ddf8ae31a0f371eff2db14c7f7a45976b86d56ea)
Co-authored-by: Dong-hee Na <donghee.na@python.org>
|
|
|
|
|
|
|
| |
(GH-27367)
(cherry picked from commit 1d582bbc969e05896addf97844ddf17ce9830e5e)
Co-authored-by: T. Wouters <thomas@python.org>
|
|
|
|
|
|
|
| |
(GH-27316) (#27325)
(cherry picked from commit 5370f0a82aaa4ba617070d5c71d2b18236096ac0)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
| |
types.GenericAlias … (GH-27016) (GH-27028)
|
|
|
|
|
| |
types.GenericAlias … (GH-27016) (GH-27018)" (GH-27022)
This reverts commit 4684a34c8d2a2ffac7b779edb4ba57f043783478.
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
(GH-26950) (GH-26960)
(cherry picked from commit e2fea101fd5517f33371b04432842b971021c3bf)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
| |
(cherry picked from commit 59242431991794064824cf2ab70886367613f29e)
Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
|
|
|
|
|
|
|
| |
(GH-25096) (GH-25847)
(cherry picked from commit 9032cf5cb1e33c0349089cfb0f6bf11ed3c30e86)
Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
| |
(cherry picked from commit e0c614e5fd017ca43cab55a9f8490133750c704f)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 2f5baa17504feb9a7613bac32fdceed4894434de)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
(GH-20628) (GH-24896)
(cherry picked from commit 3b3b83c965447a8329b34cb4befe6e9908880ee5)
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
(GH-24873)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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)
|
|
|
|
|
|
| |
(GH-23446). (GH-24057)
(cherry picked from commit ed1007c0d74e658d1e6c9b51b12ce7501eb8cbf9)
|
|
|
|
|
| |
collections.abc and typing (GH-23765)
Backport of GH-23060.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
| |
(cherry picked from commit 384b7a4bd988986bca227c7e85c32d766da74708)
|
|
|
|
|
|
|
|
| |
exeeds -> exceeds
Automerge-Triggered-By: GH:Mariatta
(cherry picked from commit 38811d68caf9b782ea7168479acb09557e126efe)
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
(GH-19940)
(cherry picked from commit 3635388f52b42e5280229104747962117104c453)
Co-authored-by: Max Bernstein <tekknolagi@users.noreply.github.com>
|
|
|
| |
(cherry picked from commit c13b847a6f913b72eeb71651ff626390b738d973)
|
|
|
|
|
|
|
| |
is kept alive long enough (GH-22670)
(cherry picked from commit 04b8631d84a870dda456ef86039c1baf34d08500)
Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net>
|
|
|
|
|
| |
(cherry picked from commit 77f0a23e7a9fb247101b9b14a060c4ba1c4b87a5)
Co-authored-by: Mikhail Golubev <qsolo825@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-22550)
Enable recursion checks which were disabled when get __bases__ of
non-type objects in issubclass() and isinstance() and when intern
strings. It fixes a stack overflow when getting __bases__ leads
to infinite recursion.
Originally recursion checks was disabled for PyDict_GetItem() which
silences all errors including the one raised in case of detected
recursion and can return incorrect result. But now the code uses
PyDict_GetItemWithError() and PyDict_SetDefault() instead.
(cherry picked from commit 9ece9cd65cdeb0a1f6e60475bbd0219161c348ac)
|
|
|
|
|
|
| |
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 2e87774df1a0eaf2a1fe8cc4d958df60f7125b6e)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
* Add failing test.
* bpo-29590: fix stack trace for gen.throw() with yield from (GH-NNNN)
When gen.throw() is called on a generator after a "yield from", the
intermediate stack trace entries are lost. This commit fixes that.
(cherry picked from commit 8b33961e4bc4020d8b2d5b949ad9d5c669300e89)
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-22020) (GH-22045)
When allocating MemoryError classes, there is some logic to use
pre-allocated instances in a freelist only if the type that is being
allocated is not a subclass of MemoryError. Unfortunately in the
destructor this logic is not present so the freelist is altered even
with subclasses of MemoryError..
(cherry picked from commit 9b648a95ccb4c3b14f1e87158f5c9f5dbb2f62c0)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
| |
Walk down the MRO backwards to find the type that originally defined the final `tp_setattro`, then make sure we are not jumping over intermediate C-level bases with the Python-level call.
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit c53b310e5926266ce267c44a168165cacd786d6e)
Co-authored-by: scoder <stefan_ml@behnel.de>
|
|
|
|
|
|
|
|
|
|
| |
(GH-21240)
The issue is triggered by the bytearray() + bytearray() operation.
Detected by GCC 10 static analysis tool.
(cherry picked from commit 61fc23ca106bc82955b0e59d1ab42285b94899e2)
Co-authored-by: stratakis <cstratak@redhat.com>
|
|
|
|
|
|
|
|
| |
"tp_setattro()" (GH-21092)
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 148f32913573c29250dfb3f0d079eb8847633621)
Co-authored-by: scoder <stefan_ml@behnel.de>
|
|
|
|
|
|
|
|
|
|
| |
(GH-20537)
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in the "in" operator and functions
operator.contains(), operator.indexOf() and operator.countOf().
(cherry picked from commit cafe1b6e9d3594a34aba50e872d4198296ffaadf)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 2c4928d37edc5e4aeec3c0b79fa3460b1ec9b60d)
|
|
|
|
|
| |
yet. (GH-20273) (GH-20782)
(cherry picked from commit 24b8bad6d30ae4fb37ee686a073adfa5308659f9)
|
|
|
|
| |
This is not part of the limited API but makes the buffer slots available for type specs.
(cherry picked from commit f7c4e236429606e1c982cacf24e10fc86ef4462f)
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyType_FromSpec types (reverts GH-19414) (GH-20264)
Heap types now always visit the type in tp_traverse. See added docs for details.
This reverts commit 0169d3003be3d072751dd14a5c84748ab63a249f.
Automerge-Triggered-By: @encukou
(cherry picked from commit 1cf15af9a6f28750f37b08c028ada31d38e818dd)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
| |
Co-authored-by: hai shi <shihai1991@126.com>
(cherry picked from commit 3f5f61409ebf95fa606bcbb15dfaaadad6084dc6)
Co-authored-by: Hai Shi <shihai1992@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12bd5359b0f66c4fbc98aa055398bcc8a7e)
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
|
|
|
|
|
|
|
| |
(GH-20228)
Remove --with-experimental-isolated-subinterpreters configure option
in Python 3.9: the experiment continues in the master branch, but
it's no longer needed in 3.9.
|