While we're debating workarounds, to note: This issue affects unattended-upgrades only once, in a non-default configuration and does not break the ability to install upgrades. After the upgrade ran, the next upgrade will work correctly (as it will have imported the new email.errors due to restarting).
This may not just affect unattended-upgrades. Third-party applications may be affected if 1. they use email.message to send or generate emails, and 2. they have not send an email prior to the update, and 3. they want to send an email after the update Their failure case may be worse in that they graciously handle failure and end up not crashing, and need a manual restart to be able to send emails again. -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to unattended-upgrades in Ubuntu. https://bugs.launchpad.net/bugs/2080940 Title: unattended-upgrades broken by python-upgrade Status in python3.10 package in Ubuntu: New Status in python3.12 package in Ubuntu: New Status in python3.8 package in Ubuntu: New Status in unattended-upgrades package in Ubuntu: Won't Fix Bug description: at least focal and jammy are affected automatic updates installed "python3.10:amd64 3.10.12-1~22.04.6" tonight. This updated does not contain functions/classes required by unattended-upgrade. It resulted in broken status-emails for me, otherwise I would not have seen. One could argue that the bug is with python3.10, since there should be no breaking changes in LTS. Sep 17 06:05:01 xxx systemd[1]: Starting Daily apt upgrade and clean activities... Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: Traceback (most recent call last): Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: File "/usr/bin/unattended-upgrade", line 2005, in main Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: send_summary_mail(res.pkgs, res.success, res.result_str, Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: File "/usr/bin/unattended-upgrade", line 1509, in send_summary_mail Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: ret = _send_mail_using_sendmail(from_email, to_email, subject, body) Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: File "/usr/bin/unattended-upgrade", line 1408, in _send_mail_using_sendmail Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: sendmail.stdin.write(msg.as_string()) Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: File "/usr/lib/python3.10/email/message.py", line 151, in as_string Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: from email.generator import Generator Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: File "/usr/lib/python3.10/email/generator.py", line 17, in <module> Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: from email.errors import HeaderWriteError Sep 17 06:05:24 xxx apt.systemd.daily[1894012]: ImportError: cannot import name 'HeaderWriteError' from 'email.errors' (/usr/lib/python3.10/email/errors.py) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python3.10/+bug/2080940/+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