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
bpo-43125: Fix: return expected type (str), not original value (bytes) in email/base64mime.py::body_encode #24476
Conversation
|
my first PR ! :) what's next ? |
Misc/NEWS.d/next/Library/2021-02-07-19-13-30.bpo-43125.AqNoMa.rst
Outdated
Show resolved
Hide resolved
|
I made the changes. what's next step ? |
Lib/test/test_email/test_email.py
Outdated
| @@ -4261,7 +4261,7 @@ def test_decode(self): | |||
|
|
|||
| def test_encode(self): | |||
| eq = self.assertEqual | |||
| eq(base64mime.body_encode(b''), b'') | |||
| eq(base64mime.body_encode(b''), '') # bpo-43125 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add # bpo-43125
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @matrixise, @corona10: please review the changes made to this pull request. |
…) in email/base64mime.py::body_encode (pythonGH-24476)
All in title.
the utility function
Lib/email/base64mime.py::body_encode:returns its given input if this one evaluates to False. This is bad. given the expected input is bytes but the expected output is str. (
return EMPTYSTRING.join(encvec)).The fix looks obvious: return an empty string instead of the original object (whatever type it might be).
https://bugs.python.org/issue43125