[Bug 2087935] Re: DeprecationWarning for multi-threaded fork() under Python 3.12
Thomas Hoffmann
2087935 at bugs.launchpad.net
Fri Nov 21 15:03:57 UTC 2025
Hm... the fix is just to filter Deprecation Warnings and hide them(?)
Some background information can be found at https://docs.python.org/3/whatsnew/3.12.html
"On POSIX platforms, os.fork() can now raise a DeprecationWarning when
it can detect being called from a multithreaded process. There has
always been a fundamental incompatibility with the POSIX platform when
doing so. Even if such code appeared to work. We added the warning to
raise awareness as issues encountered by code doing this are becoming
more frequent. See the os.fork() documentation for more details along
with this discussion on fork being incompatible with threads for why
we’re now surfacing this longstanding platform compatibility problem to
developers."
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to unattended-upgrades in Ubuntu.
https://bugs.launchpad.net/bugs/2087935
Title:
DeprecationWarning for multi-threaded fork() under Python 3.12
Status in unattended-upgrades package in Ubuntu:
Confirmed
Status in unattended-upgrades package in Debian:
New
Bug description:
We run unattended-upgrades on a lot of servers, but on Ubuntu noble (Ubuntu 24.04.1 LTS) we're getting a lot of cron spam that doesn't appear elsewhere:
> /usr/bin/unattended-upgrade:567: DeprecationWarning: This process (pid=475626) is multi-threaded, use of fork() may lead to deadlocks in the child.
> pid = os.fork()
The above message appears several times during an upgrade; the count
is different each week, presumably relating to what operations are
needed.
lsb_release -rd:
No LSB modules are available.
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Relevant packages:
unattended-upgrades 2.9.1+nmu4ubuntu1
python3.12 3.12.3-1ubuntu0.2
The warning appears to be introduced in Python 3.12 - https://docs.python.org/3/whatsnew/3.12.html
> On POSIX platforms, os.fork() can now raise a DeprecationWarning when it can detect being called from a multithreaded process
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/2087935/+subscriptions
More information about the foundations-bugs
mailing list