Issue 25951: SSLSocket.sendall() does not return None on success like socket.sendall() (original) (raw)

Created on 2015-12-25 14:45 by progval, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
25951.patch palaviv,2016-03-24 18:01 review
25951-2.patch palaviv,2016-03-25 08:57 review
Messages (7)
msg256992 - (view) Author: progval (progval) Date: 2015-12-25 14:45
socket.sendall() returns None if it succeeded <https://docs.python.org/3/library/socket.html#socket.socket.sendall> SSLSocket.sendall() is said to have the same behavior as socket.sendall(), besides not allowing flags <https://docs.python.org/3/library/ssl.html#ssl.SSLSocket> However, SSLSocket.sendall() returns the amount of bytes written on success.
msg262370 - (view) Author: Aviv Palivoda (palaviv) * Date: 2016-03-24 18:01
Changed SSLSocket.sendall() to return None. Also added a check of the return value of the SSLSocket.send(), SSLSocket.sendall() in the tests.
msg262388 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-03-25 00:04
Agreed that the documentation and implementation should match. But this seems like a rather low-priority bug. What use case relies on the return value being None? If there is no immediate need for this change, it might be safer to just make it in 3.6, to minimize compatibility problems. But if it is fixed in 3.5 it should also be fixed in 2.7. I left some suggestions to simplify the code.
msg262409 - (view) Author: Aviv Palivoda (palaviv) * Date: 2016-03-25 08:57
Thanks for the review. I don't have any use cases for this change. I just saw this issue while looking for something else and thought I will give it a try.
msg262479 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-03-26 01:02
Thanks for your work Aviv. This version looks good to me.
msg262810 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-03 02:38
New changeset 92947704321c by Martin Panter in branch 'default': Issue #25951: Fix SSLSocket.sendall() to return None, by Aviv Palivoda https://hg.python.org/cpython/rev/92947704321c
msg262812 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-04-03 03:58
I made some simple tweaks to avoid long lines.
History
Date User Action Args
2022-04-11 14:58:25 admin set github: 70139
2016-04-03 03:58:59 martin.panter set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2016-04-03 02:38:09 python-dev set nosy: + python-devmessages: +
2016-03-26 01:02:51 martin.panter set messages: + versions: - Python 3.5
2016-03-25 08:57:24 palaviv set files: + 25951-2.patchmessages: +
2016-03-25 00:04:13 martin.panter set nosy: + martin.pantermessages: + stage: patch review
2016-03-24 18:01:31 palaviv set files: + 25951.patchnosy: + palavivmessages: + keywords: + patch
2015-12-25 15:00:43 SilentGhost set nosy: + janssen, pitrou, giampaolo.rodola, christian.heimes, alex, dstuffttype: behaviorversions: + Python 3.5, Python 3.6, - Python 3.4
2015-12-25 14:45:15 progval create