This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pitrou, vstinner
Date 2016-03-19.13:18:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwbzvhDmykvJtojSdMUA0EqT=9HCSetOfBAZ7N_kLrZ05Q@mail.gmail.com>
In-reply-to <56ED50DA.5020709@free.fr>
Content
Antoine Pitrou added the comment:
> Ah, that's probably because socket.socket is a Python subclass.
> What happens if you use _socket.socket directly instead?

Oh, I forgot this sublte implementation detail, _socket.socket base
class vs socket.socket sublcass.

Example with _socket:
---
import _socket
s=_socket.socket()
s=None
---

Ok, in this case sock_finalize() is called by sock_dealloc().
---
#0  sock_finalize (s=0x7ffff7eaad60) at
/home/haypo/prog/python/default/Modules/socketmodule.c:4172
#1  0x00000000004d8f59 in PyObject_CallFinalizer (self=<_socket.socket
at remote 0x7ffff7eaad60>) at Objects/object.c:294
#2  0x00000000004d8fcd in PyObject_CallFinalizerFromDealloc
(self=<_socket.socket at remote 0x7ffff7eaad60>) at
Objects/object.c:311
#3  0x00007ffff04e326a in sock_dealloc (s=0x7ffff7eaad60) at
/home/haypo/prog/python/default/Modules/socketmodule.c:4192
#4  0x00000000004dc8ae in _Py_Dealloc (op=<_socket.socket at remote
0x7ffff7eaad60>) at Objects/object.c:1783
---
History
Date User Action Args
2016-03-19 13:18:30vstinnersetrecipients: + vstinner, pitrou
2016-03-19 13:18:30vstinnerlinkissue26590 messages
2016-03-19 13:18:30vstinnercreate