Skip to content
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

SSLSocket.sendall() does not return None on success like socket.sendall() #70139

Closed
progval mannequin opened this issue Dec 25, 2015 · 7 comments
Closed

SSLSocket.sendall() does not return None on success like socket.sendall() #70139

progval mannequin opened this issue Dec 25, 2015 · 7 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@progval
Copy link
Mannequin

progval mannequin commented Dec 25, 2015

BPO 25951
Nosy @pitrou, @giampaolo, @tiran, @alex, @vadmium, @dstufft, @palaviv
Files
  • 25951.patch
  • 25951-2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-04-03.03:58:59.950>
    created_at = <Date 2015-12-25.14:45:15.904>
    labels = ['type-bug', 'library']
    title = 'SSLSocket.sendall() does not return None on success like socket.sendall()'
    updated_at = <Date 2016-04-03.03:58:59.949>
    user = 'https://bugs.python.org/progval'

    bugs.python.org fields:

    activity = <Date 2016-04-03.03:58:59.949>
    actor = 'martin.panter'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-04-03.03:58:59.950>
    closer = 'martin.panter'
    components = ['Library (Lib)']
    creation = <Date 2015-12-25.14:45:15.904>
    creator = 'progval'
    dependencies = []
    files = ['42278', '42285']
    hgrepos = []
    issue_num = 25951
    keywords = ['patch']
    message_count = 7.0
    messages = ['256992', '262370', '262388', '262409', '262479', '262810', '262812']
    nosy_count = 10.0
    nosy_names = ['janssen', 'pitrou', 'giampaolo.rodola', 'christian.heimes', 'alex', 'progval', 'python-dev', 'martin.panter', 'dstufft', 'palaviv']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue25951'
    versions = ['Python 3.6']

    @progval
    Copy link
    Mannequin Author

    progval mannequin commented Dec 25, 2015

    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.

    @progval progval mannequin added the stdlib Python modules in the Lib dir label Dec 25, 2015
    @SilentGhost SilentGhost mannequin added the type-bug An unexpected behavior, bug, or error label Dec 25, 2015
    @palaviv
    Copy link
    Mannequin

    palaviv mannequin commented Mar 24, 2016

    Changed SSLSocket.sendall() to return None. Also added a check of the return value of the SSLSocket.send(), SSLSocket.sendall() in the tests.

    @vadmium
    Copy link
    Member

    vadmium commented Mar 25, 2016

    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.

    @palaviv
    Copy link
    Mannequin

    palaviv mannequin commented Mar 25, 2016

    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.

    @vadmium
    Copy link
    Member

    vadmium commented Mar 26, 2016

    Thanks for your work Aviv. This version looks good to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 3, 2016

    New changeset 92947704321c by Martin Panter in branch 'default':
    Issue bpo-25951: Fix SSLSocket.sendall() to return None, by Aviv Palivoda
    https://hg.python.org/cpython/rev/92947704321c

    @vadmium
    Copy link
    Member

    vadmium commented Apr 3, 2016

    I made some simple tweaks to avoid long lines.

    @vadmium vadmium closed this as completed Apr 3, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant