Send mail throws UnicodeEncodeError under python 3.11.9

Hi there!

We’re hitting a bug in production with django 4.2.11 and python 3.11.9 due to recent changes in python. I can see a fix for it on django github which is great.

But I can only see it attached to issue #34900 related to python 3.13, which will be supported by django 5.1. And I am wondering if it will be packed in the next patch release of 4.2 ?

That would be great because for now we stick to 3.11.8 as a workaround but it’s not ideal. Do I need to create a ticket for it to be added in the next patch release?

There are related back port issues for both 3.12 and 3.11, so it looks like we would need matching backports here too. //cc @nessita @sarahboyce

Thank you everyone, Sarah and I are actively looking into this, will update the post with details as we have them.

1 Like

Thanks, our pipeline wasn’t working anymore this week dued to the version 3.11.9 with this error. We locked to 3.11.8 and it was solved for now. Thanks!

An update on this topic:

  • Mariusz has updated the Python versions in Jenkins CI so we run the latest and are able to catch issues like this and also tests the fixes.
  • We’ll backport revision b231bcd19e57267ce1fc21d42d46f0b65fdcfcf8 to Django 5.0.5 and 4.2.12, with release date set for May 6th.
  • We have a PR that that will be merged soon which adds a test, and release notes to be backported to stable branches.

Thank you everyone!

2 Likes