Author vstinner
Recipients christian.heimes, ezio.melotti, njs, pitrou, smurfix, vstinner
Date 2018-03-27.22:01:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Lib/test/support/ complains about dangling threads even if the reference in question would be cleaned up by the garbage collector.

It's a deliberate choice. It helped me to find real bugs. For example, I found a very old reference cycle in socket.create_connection().

The error message ("dangling threads") doesn't help, but it means that "something is wrong" in your test.

Sadly, sometimes you have to explicitly do something like "self.thread = None" in your test.

I wrote an article to explain these things:

Instead of calling support.gc_collect(), I suggest to write documentation, maybe as a comment in support.threading_cleanup()?, explaining the warning and how to fix it. Maybe with a link to this issue? :-)
Date User Action Args
2018-03-27 22:01:11vstinnersetrecipients: + vstinner, pitrou, christian.heimes, ezio.melotti, smurfix, njs
2018-03-27 22:01:11vstinnersetmessageid: <>
2018-03-27 22:01:11vstinnerlinkissue32850 messages
2018-03-27 22:01:11vstinnercreate