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

Admin: Support Py 3.13 #7984

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Conversation

bblommers
Copy link
Collaborator

@bblommers bblommers commented Aug 15, 2024

The SES changes are due to a logic bug that only manifests in Python3.13.

When no CC/BCC fields are set, the fieldvalues would be set to something like: ['to@example.com, foo@example.com', '', '']
Sending that to the builtin emails.utils.getaddresses-method in Python 3.12 results in:
[('', 'to@example.com'), ('', 'foo@example.com'), ('', '')]

But in Python 3.13, this results in an empty list.

This PR ensures that there are no empty strings in fieldvalues, which in turns means that the getaddresses-method keeps working.

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.37%. Comparing base (459be00) to head (fda9266).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7984   +/-   ##
=======================================
  Coverage   94.37%   94.37%           
=======================================
  Files        1125     1125           
  Lines       96356    96356           
=======================================
  Hits        90935    90935           
  Misses       5421     5421           
Flag Coverage Δ
servertests 28.93% <0.00%> (ø)
unittests 94.34% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bblommers bblommers force-pushed the admin/support-py-3.13 branch from 4317323 to 111d29d Compare August 15, 2024 20:41
@bblommers bblommers added this to the 5.0.13 milestone Aug 15, 2024
@bblommers bblommers force-pushed the admin/support-py-3.13 branch from 111d29d to fda9266 Compare August 15, 2024 20:49
@bblommers bblommers marked this pull request as ready for review August 15, 2024 21:21
@bblommers bblommers merged commit 856ded1 into getmoto:master Aug 15, 2024
48 checks passed
@bblommers bblommers deleted the admin/support-py-3.13 branch August 15, 2024 21:21
Copy link
Contributor

This is now part of moto >= 5.0.13.dev54

@cas--
Copy link

cas-- commented Sep 26, 2024

We encountered this bug in our CI pipeline where different 3.10 point releases have flip-flopped between success (3.10.11, 3.10.13, 3.10.14) and failure (3.10.12, 3.10.15) based on this getaddresses call.

So for reference this actually resolve a problem with all the latest Python versions since they now all default to a new strict=True argument based around this bug fix: python/cpython#102988

  • Python 3.8.20 onwards
  • Python 3.9.20 onwards
  • Python 3.10.15 onwards
  • Python 3.11.10 onwards
  • Python 3.12.16 onwards
  • Python 3.13

@bblommers
Copy link
Collaborator Author

TIL! Thanks for sharing @cas-- - I had no idea this was all due to a CVE.

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.

2 participants