Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 40 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprisesbpo-31711: On SSLObject.write method, added assert that data has content. #17671
Conversation
…void to rise ssl.SSLEOFError on petition that has no content on response.
This comment has been minimized.
This comment has been minimized.
the-knights-who-say-ni
commented
Dec 20, 2019
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
This comment has been minimized.
This comment has been minimized.
raulcd
commented
Dec 22, 2019
Hi, |
@@ -894,7 +894,10 @@ def write(self, data): | |||
The 'data' argument must support the buffer interface. | |||
""" | |||
return self._sslobj.write(data) | |||
if data != b'': |
This comment has been minimized.
This comment has been minimized.
if data != b'': | ||
return self._sslobj.write(data) | ||
else: | ||
return "" |
This comment has been minimized.
This comment has been minimized.
tiran
Dec 23, 2019
Member
write
returns the number of bytes sent. The function should either return 0
or fail with a more useful exception.
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Dec 23, 2019
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 |
This comment has been minimized.
This comment has been minimized.
See https://bugs.python.org/issue31711 for some discussion. Currently, the behaviour is undefined, i.e. instead of an exception something else may happen. Some code change is required to achieve defined behaviour, whichever that is. I prefer a noop. |
This comment has been minimized.
This comment has been minimized.
slingamn
commented
Dec 24, 2019
Previous PR implementing no-op behavior: #7559 |
choyos commentedDec 20, 2019
•
edited by bedevere-bot
This avoid to rise ssl.SSLEOFError on petition that has no content on response.
https://bugs.python.org/issue31711