Skip to content

Conversation

@seanthegeek
Copy link

@seanthegeek seanthegeek commented Dec 6, 2025

Fix #618 without needing to access undocumented Python imaplib attributes that should not be modified, such as file. Tested against Gmail IMAP TLS on Python 3.8, 3.13, and 3.14 using this test script

import ssl
from imapclient import IMAPClient


HOST = "imap.gmail.com"
PORT = 993


def main() -> None:
    ctx = ssl.create_default_context()
    with IMAPClient(
        HOST,
        port=PORT,
        ssl=True,
        ssl_context=ctx,
        timeout=30,
    ) as client:
        print("Connected to:", HOST, PORT)
        print("welcome:", client.welcome)

        caps = client.capabilities()
        print("capabilities:", caps)
        print("Successfully connected and ran CAPABILITY without auth.")


if __name__ == "__main__":
    main()

See also

python/cpython#142307
seanthegeek/mailsuite#15
domainaware/parsedmarc#636

@JohnVillalovos
Copy link
Contributor

Would it also make sense to update .github/workflows/main.yml to use Python 3.14?

@seanthegeek
Copy link
Author

seanthegeek commented Dec 6, 2025

Would it also make sense to update .github/workflows/main.yml to use Python 3.14?

Good point. Added to workflow and updated docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: property 'file' of 'IMAP4_TLS' object has no setter on Python 3.14

2 participants