Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailbox._get_mailbox_client fails on Python 3.12 #214

Closed
link2xt opened this issue Oct 3, 2023 · 2 comments
Closed

Mailbox._get_mailbox_client fails on Python 3.12 #214

link2xt opened this issue Oct 3, 2023 · 2 comments
Labels

Comments

@link2xt
Copy link

link2xt commented Oct 3, 2023

Here is an error from CI:

self = <imap_tools.mailbox.MailBox object at 0x106d83800>

    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(self._host, self._port, self._keyfile, self._certfile, self._ssl_context,
                                     self._timeout)
E           TypeError: IMAP4_SSL.__init__() takes from 1 to 3 positional arguments but 7 were given

Since Python 3.12 only host and port are positional arguments. ssl_context and timeout must be keyword arguments, while keyfile and certfile are deprecated: https://docs.python.org/3.12/library/imaplib.html#imaplib.IMAP4_SSL

@ikvk
Copy link
Owner

ikvk commented Oct 3, 2023

Thanks, will fix soon

@ikvk
Copy link
Owner

ikvk commented Oct 4, 2023

@ikvk ikvk closed this as completed Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants