Public bug reported: 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(target=thread_method, args=(), name='daemon_exit_test', daemon=True) thread_test.start() print(thread_test.isDaemon()) 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 ProcVersionSignature: Ubuntu 6.5.0-17.17-generic 6.5.8 Uname: Linux 6.5.0-17-generic x86_64 NonfreeKernelModules: nvidia_modeset nvidia ApportVersion: 2.27.0-0ubuntu5 Architecture: amd64 CasperMD5CheckResult: pass 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) ** Affects: python3-defaults (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug mantic -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to python3-defaults in Ubuntu. https://bugs.launchpad.net/bugs/2054468 Title: python3 deamon thread not auto-ending on script end Status in python3-defaults package in Ubuntu: New 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(target=thread_method, args=(), name='daemon_exit_test', daemon=True) thread_test.start() print(thread_test.isDaemon()) 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 ProcVersionSignature: Ubuntu 6.5.0-17.17-generic 6.5.8 Uname: Linux 6.5.0-17-generic x86_64 NonfreeKernelModules: nvidia_modeset nvidia ApportVersion: 2.27.0-0ubuntu5 Architecture: amd64 CasperMD5CheckResult: pass 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) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/2054468/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp