gh-134759: `UnboundLocalError` in `email.message.Message.get_payload`
Hello!
I worked on #134759 and was able to reproduce the UnboundLocalError by passing bytes payload directly to _payload. I'm not sure can we do it in a "public" way, like throw .set_payload() but if payload some how become bytes (and content-transfer-encoding is equal quoted-printable) it is now not falling :)
I'm also add myself to ACKS list, but not sure is my changes enough for it. If you say I'll remove myself with no questions.
- Issue: gh-134759
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
As a bugfix I think we can keep this but in a follow-up PR I think we should ensure that we are only having a list, str or bytes or handle buffer objects by wrapping them into bytes.
As a bugfix I think we can keep this but in a follow-up PR I think we should ensure that we are only having a list, str or bytes or handle buffer objects by wrapping them into bytes.
Got it. If nobody mind I can open an issue (or keep in #134759 ?) and take it in work :)
I'm travelling for now but a separate issue for discussion would be better. It could break backwards compatibility so we should be careful.
I'm also add myself to ACKS list, but not sure is my changes enough for it. If you say I'll remove myself with no questions.
IMO even contributors fixing a single typo can be added to this file so no worry!
Thanks @skv0zsneg for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. 🐍🍒⛏🤖
GH-136579 is a backport of this pull request to the 3.14 branch.
GH-136580 is a backport of this pull request to the 3.13 branch.