Package: python3-imap-tools
Version: 0.54.0+dfsg-1
Severity: important
The following python code fails on 3.12:
from imap_tools import MailBox
MailBox('myserver_address')
File "/usr/lib/python3/dist-packages/imap_tools/mailbox.py", line 303, in
_get_mailbox_client
return imaplib.IMAP4_SSL(self._host, self._port, self._keyfile,
self._certfile, self._ssl_context,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: IMAP4_SSL.__init__() takes from 1 to 3 positional arguments but
7 were given
This fixes the issue:
- def _get_mailbox_client(self) -> imaplib.IMAP4:
- if PYTHON_VERSION_MINOR < 9:
- return imaplib.IMAP4_SSL(self._host, self._port, self._keyfile,
self._certfile, self._ssl_context)
- else:
- return imaplib.IMAP4_SSL(elf._host, self._port, self._keyfile,
self._certfile, self._ssl_context, self._timeout)
+ def _get_mailbox_client(self) -> imaplib.IMAP4:
+ if PYTHON_VERSION_MINOR < 9:
+ return imaplib.IMAP4_SSL(self._host, self._port, self._keyfile,
self._certfile, self._ssl_context)
+ elif PYTHON_VERSION_MINOR < 12:
+ return imaplib.IMAP4_SSL(self._host, self._port, self._keyfile,
self._certfile, self._ssl_context, self._timeout)
+ else:
+ return imaplib.IMAP4_SSL(self._host, self._port,
ssl_context=self._ssl_context, timeout=self._timeout)
But it is also fixed upstream:
https://github.com/ikvk/imap_tools/commit/acae531939d4877c93da042292ebe58e28a6637e
//Yuri
-- System Information:
Debian Release: trixie/sid
APT prefers unstable
APT policy: (670, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.9.10-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-imap-tools depends on:
ii python3 3.12.4-1
python3-imap-tools recommends no packages.
python3-imap-tools suggests no packages.
-- no debconf information