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

Python 3.12 SSL module removed "keyfile" in SMTP_SSL #134

Open
Lymkwi opened this issue Feb 15, 2024 · 3 comments
Open

Python 3.12 SSL module removed "keyfile" in SMTP_SSL #134

Lymkwi opened this issue Feb 15, 2024 · 3 comments
Assignees
Labels
bug Something isn't working priority:high High Priority

Comments

@Lymkwi
Copy link
Collaborator

Lymkwi commented Feb 15, 2024

At the moment, trying to send an email with the current version of Django makes the backend explode:

  File "/app/insalan/user/views.py", line 213, in post
    UserMailer.send_password_reset(user_object)
  File "/app/insalan/user/models.py", line 180, in send_password_reset
    send_mail(
  File "/usr/local/lib/python3.12/site-packages/django/core/mail/__init__.py", line 87, in send_mail
    return mail.send()
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/core/mail/message.py", line 298, in send
    return self.get_connection(fail_silently).send_messages([self])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/core/mail/backends/smtp.py", line 124, in send_messages
    new_conn_created = self.open()
                       ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/core/mail/backends/smtp.py", line 80, in open
    self.connection = self.connection_class(
                      ^^^^^^^^^^^^^^^^^^^^^^
TypeError: SMTP_SSL.__init__() got an unexpected keyword argument 'keyfile'
[15/Feb/2024 16:27:42] "POST /v1/user/password-reset/ask/ HTTP/1.0" 500 109706

As it turns out, smtplib.SMTP_SSL which is used by Django changed its code and now Django 4.2.7 has to follow.

@Lymkwi Lymkwi added bug Something isn't working priority:high High Priority labels Feb 15, 2024
@KwikKill
Copy link
Member

KwikKill commented Feb 15, 2024

This is already fixed on prod server, python 3.12 is not compatible with our django version.
Using 3.11 is working fine, this was a fast fix, i forgot to push it to dev.

@KwikKill KwikKill self-assigned this Feb 15, 2024
@Lymkwi
Copy link
Collaborator Author

Lymkwi commented Feb 15, 2024

Alright, that makes sense.

Actually, we should look into upgrading django, django_rest_framework and djongo as much as possible. For one of them (djongo), the releases seem dead, and a fork (djongo5) has been created to provide support for Django 5.X.

@KwikKill
Copy link
Member

Yes, this is planned but for now, the easiest fix was to stay in python3.11 until the end of the LAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:high High Priority
Projects
None yet
Development

No branches or pull requests

2 participants