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

Attach method different behaviour from version 0.9.1 to 0.10.0 #234

Open
fan-droide opened this issue Feb 13, 2025 · 1 comment
Open

Attach method different behaviour from version 0.9.1 to 0.10.0 #234

fan-droide opened this issue Feb 13, 2025 · 1 comment

Comments

@fan-droide
Copy link

Error: 'list' object has no attribute 'items'

When I started running Flask-Mail version 0.10.0 I encountered the aforementioned issue, so I had to change the following line code:

 msg.attach("image.jpg", "image/jpeg", fp.read(), headers=[('Content-ID', '<image1>')])

To this:

msg.attach("image.jpg", "image/jpeg", fp.read(), headers={"Content-ID": "<image1>"})

Previously I was using Flask-Mail 0.9.1 but I found that with that version the parameter (headers={"Content-ID": "<image1>"}) does not work either and throws the error

Error: too many values to unpack (expected 2)

It should not throw any of the above mentioned errors

Environment:

  • Python version: 3.9.6
  • Flask-Mail version: 0.10.0 / 0.9.1
  • Flask version: 3.1.0
@ThiefMaster
Copy link
Contributor

0.9 to 0.10 can contain breaking changes even when following semver. and to me the new way looks clearly better.

it should, however, be added to the changelog, unless the old option w/ the list was undocumented and never expected to be a valid alternative

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

No branches or pull requests

2 participants