python3 deamon thread not auto-ending on script end
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3-defaults (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Python programs using threading with deamon = True not longer kill the thread once the python script is finished.
Here is a simple script to prove the point:
---
import threading as th
def thread_method():
input()
thread_test = th.Thread(
thread_test.start()
print(thread_
print('print this then exit')
---
This creates a deamon thread, and holds it waiting for an input(), i.e. enter key.
In the past, because the flag deamon=True, as soon as it reaches the end of the script it will kill the thread. Now it does not behave like that, and holds the thread open, which can be ended manually by pushing the enter key to accept the input().
I tried in a python 3.9 and a python 3.12 environment, same issue.
Kernel Linux 6.5.0-17-generic x86_64
ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: python3 3.11.4-5
ProcVersionSign
Uname: Linux 6.5.0-17-generic x86_64
NonfreeKernelMo
ApportVersion: 2.27.0-0ubuntu5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: MATE
Date: Wed Feb 21 09:15:49 2024
InstallationDate: Installed on 2023-07-02 (234 days ago)
InstallationMedia: Ubuntu-MATE 23.04 "Lunar Lobster" - Release amd64 (20230415)
SourcePackage: python3-defaults
UpgradeStatus: Upgraded to mantic on 2024-02-17 (4 days ago)