[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-27 Thread Martin Panter
Martin Panter added the comment: The Python 2 fix was slightly different, due to the lack of Argument Clinic. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset af92651c22e9 by Martin Panter in branch '3.5': Issue #26644: Raise ValueError for negative SSLSocket.recv() and read() https://hg.python.org/cpython/rev/af92651c22e9 New changeset b84d136e0028 by Martin Panter in branch '2.7': Issue #26644: Raise

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: -> martin.panter nosy: +serhiy.storchaka stage: patch review -> commit review ___ Python tracker

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-26 Thread Martin Panter
Martin Panter added the comment: Thanks for the reviews. Here is a patch that avoids breaking read(-1, buffer). -- Added file: http://bugs.python.org/file42299/ssl-negative.v2.patch ___ Python tracker

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: Thanks for the explanation. Your patch lgtm. On Sat, Mar 26, 2016, at 15:01, Martin Panter wrote: > > Martin Panter added the comment: > > Socket objects aren’t exactly file-like. Plain non-SSL sockets don’t even > have read() methods. > > I think giving

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-26 Thread Martin Panter
Martin Panter added the comment: Socket objects aren’t exactly file-like. Plain non-SSL sockets don’t even have read() methods. I think giving a meaning to recv(-1) would be an (unwanted) new feature, rather than a bug fix. If you want a file-like object linked to a socket, I would suggest

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: Is this what other file-like objects do with negatives sizes? -- nosy: +benjamin.peterson ___ Python tracker ___

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-26 Thread Martin Panter
Martin Panter added the comment: Proposed patch -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file42295/ssl-negative.patch ___ Python tracker

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-26 Thread Martin Panter
New submission from Martin Panter: SystemError indicates an internal error that is not supposed to be triggerable from Python code. We should probably raise ValueError like plain sockets instead. >>> s = create_connection(("python.org", 443)) >>> s.recv(-1) Traceback (most recent call last):