Skip to content

bpo-43125: Fix: return expected type (str), not original value (bytes) in email/base64mime.py::body_encode#24476

Merged
corona10 merged 5 commits intopython:masterfrom
gst:43125_solution
Mar 30, 2021
Merged

bpo-43125: Fix: return expected type (str), not original value (bytes) in email/base64mime.py::body_encode#24476
corona10 merged 5 commits intopython:masterfrom
gst:43125_solution

Conversation

@gst
Copy link
Copy Markdown
Contributor

@gst gst commented Feb 7, 2021

All in title.

the utility function Lib/email/base64mime.py::body_encode :

def body_encode(s, maxlinelen=76, eol=NL):

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

@gst gst changed the title bpo-43125: Fix: return expected type (str), not original value (bytes) bpo-43125: Fix: return expected type (str), not original value (bytes) in email/base64mime.py::body_encode Feb 9, 2021
@gst
Copy link
Copy Markdown
Contributor Author

gst commented Feb 9, 2021

@matrixise

my first PR ! :)

what's next ?

Copy link
Copy Markdown
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm
but @serhiy-storchaka Can you please take a look also?

@gst
Copy link
Copy Markdown
Contributor Author

gst commented Mar 3, 2021

@corona10 @serhiy-storchaka

I made the changes. what's next step ?

@bedevere-bot
Copy link
Copy Markdown

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@gst
Copy link
Copy Markdown
Contributor Author

gst commented Mar 10, 2021

I have made the requested changes; please review again

@bedevere-bot
Copy link
Copy Markdown

Thanks for making the requested changes!

@matrixise, @corona10: please review the changes made to this pull request.

@gst
Copy link
Copy Markdown
Contributor Author

gst commented Mar 19, 2021

@matrixise @corona10 ?

Copy link
Copy Markdown
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@corona10 corona10 merged commit cf35e05 into python:master Mar 30, 2021
@gst gst deleted the 43125_solution branch May 21, 2023 12:03
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.

5 participants