Eryk Sun added the comment:
The _ctypes extension module could have a dict that maps each format code to
its (size, alignment), based on `formattable`. Then direct size comparisons
wouldn't be limited to types defined by the struct module, and it wouldn't be
necessary to create c_longdouble
Irit Katriel added the comment:
Looks like the long double issue is still there in 3.11
>>> import gc
>>> gc.set_debug(gc.DEBUG_LEAK)
>>> import ctypes
gc: collectable
gc: collectable
gc: collectable
gc: collectable
gc: collectable
gc: collectable
gc: collectable
gc: collectable
gc:
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
Meador, can we close this issue?
--
nosy: +amaury.forgeotdarc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12142
___
Meador Inge mead...@gmail.com added the comment:
Meador, can we close this issue?
I wanted to keep it open until the 'long double' problem is fixed as well.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12142
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 205da7a19a78 by Meador Inge in branch '3.2':
Issue #12142: Fixed reference cycle when importing ctypes
http://hg.python.org/cpython/rev/205da7a19a78
New changeset b228d9da8bd3 by Meador Inge in branch 'default':
poq p...@gmx.com added the comment:
I've attached a patch for the _array_type change.
The long double fix is probably dependent on PEP3118 (#3132).
--
keywords: +patch
Added file: http://bugs.python.org/file24413/ctypes-leak.patch
___
Python tracker
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +meador.inge
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12142
___
___
Python-bugs-list
Vlad Riscutia riscutiav...@gmail.com added the comment:
I ran full test suit after making the _array_type = type(Array) change and
everything passes.
I also took a look at this and found additional leak. gc shows this as garbage:
[(class '_ctypes._SimpleCData',), class 'ctypes.c_longdouble',
poq p...@gmx.com added the comment:
Tests succeed with this change.
There is only one use of _array_type, which is in the same module. This use is
presumably tested, because the test fails if I change the line to _array_type =
type(Structure).
In fact, everything must behave exactly the same
Terry J. Reedy tjre...@udel.edu added the comment:
Thank you for the test and explanation. There currently is no specific cytpes
maintainer. But from what you have said, I might feel comfortable enough
applying this, if no one else does, when I have the necessary setup on a new
machine.
Terry J. Reedy tjre...@udel.edu added the comment:
If you are able to rebuild Python, have you tried running the ctypes test after
rebuilding with this change? And, does the test cover the internal uses of
_array_type?
--
nosy: +terry.reedy
___
Changes by poq p...@gmx.com:
--
title: eference cycle when importing ctypes - Reference cycle when importing
ctypes
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12142
___
12 matches
Mail list logo