- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.3k
Closed as not planned
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
import time, _thread
class F:
    def __del__(self):
        print("del")
def waitingThread():
    lock.release()
    f = F()
    time.sleep(10)
lock = _thread.allocate_lock()
lock.acquire()
_thread.start_new_thread(waitingThread, ())
lock.acquire()I anticipate "del" text to be printed.
But it seems that f is not decrefed to zero, and __del__ method is not called.
FWIW, this code snippet is a variant of test.test_threading.ThreadTests.test_finalize_running_thread.
CPython versions tested on:
CPython main branch, 3.11.2
Operating systems tested on:
linux
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error