[issue1103213] Adding the missing socket.recvall() method

2015-09-03 Thread STINNER Victor
STINNER Victor added the comment: recvall.patch: implement socket.socket.recvall() in pure Python. It raises a new socket.IncompleteReadError (copied from asyncio) exception if the connection is closed before we got the expected number of bytes. The patch has unit tests, document the new metho

[issue1103213] Adding the missing socket.recvall() method

2015-04-03 Thread STINNER Victor
STINNER Victor added the comment: > - I've learned that MSG_WAITALL may be unreliable on certain systems, so any > implementation of recvall depending on MSG_WAITALL may inexplicably fail on > such systems Something else occurred since 5 years: the PEP 475 was accepted, it makes Python more r

[issue1103213] Adding the missing socket.recvall() method

2015-01-19 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone : -- nosy: -exarkun ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue1103213] Adding the missing socket.recvall() method

2015-01-16 Thread Irmen de Jong
Irmen de Jong added the comment: I created the patch about 5 years ago and in the meantime a few things have happened: - I've not touched C for a very long time now - I've learned that MSG_WAITALL may be unreliable on certain systems, so any implementation of recvall depending on MSG_WAITALL ma

[issue1103213] Adding the missing socket.recvall() method

2015-01-16 Thread STINNER Victor
STINNER Victor added the comment: The patch uses the flag MSG_WAITALL for recv() if available. Extract of the manual page: MSG_WAITALL (since Linux 2.2) This flag requests that the operation block until the full request is satisfied. However, the call

[issue1103213] Adding the missing socket.recvall() method

2015-01-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm frankly not sure why this is useful. If you want a guaranteed read size you should use the buffered layer - i.e. socket.makefile(). No need to complicate the raw socket implementation. -- nosy: +pitrou ___ Pytho

[issue1103213] Adding the missing socket.recvall() method

2015-01-06 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue1103213] Adding the missing socket.recvall() method

2014-12-31 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- nosy: -akuchling ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue1103213] Adding the missing socket.recvall() method

2014-02-03 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue1103213] Adding the missing socket.recvall() method

2010-08-19 Thread Mark Lawrence
Mark Lawrence added the comment: @Irmen if you do proceed with this it should be against the py3k trunk. -- nosy: +BreamoreBoy versions: +Python 3.2 -Python 2.7 ___ Python tracker ___

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Irmen de Jong added the comment: Currently if MSG_WAITALL is defined, recvall() just calls recv() internally with the extra flag. Maybe that isn't the smartest thing to do because it duplicates recv's behavior on errors. Which is: release the data and raise an error. Would it be nicer to have

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Just a couple comments: * If MSG_WAITALL is defined and a signal interrupts recv, will a string shorter than requested will be returned by sock_recvall? * Since MSG_WAITALL is already exposed to Python (when the underlying platform provides it), I wo

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Changes by Irmen de Jong : Added file: http://bugs.python.org/file16764/docpatch.txt ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Changes by Irmen de Jong : Added file: http://bugs.python.org/file16763/libpatch.txt ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Changes by Irmen de Jong : Added file: http://bugs.python.org/file16762/socketmodulepatch.txt ___ Python tracker ___ ___ Python-bugs-list ma

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Changes by Irmen de Jong : Removed file: http://bugs.python.org/file6439/patch.txt ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Irmen de Jong added the comment: Ok I think I've got the code and doc changes ready. I added a recvall and a recvall_into method to the socket module. Any partially received data in case of errors is returned to the application as part of the args for a new exception, socket.partialdataerror.

[issue1103213] Adding the missing socket.recvall() method

2010-03-16 Thread Irmen de Jong
Irmen de Jong added the comment: Ok I've looked at it again and think I can build an acceptable patch this time. However there are 2 things that I'm not sure of: 1) how to return the partial data to the application if the recv() loop fails before completion. Because the method will probably r

[issue1103213] Adding the missing socket.recvall() method

2010-03-16 Thread Irmen de Jong
Irmen de Jong added the comment: Sure, I'll give it another go. I've not done any c-development for quite a while though, so I have to pick up the pieces and see how far I can get. Also, I don't have any compiler for Windows so maybe I'll need someone else to validate the patch on Windows for

[issue1103213] Adding the missing socket.recvall() method

2009-02-14 Thread Daniel Diniz
Changes by Daniel Diniz : -- stage: -> test needed type: -> feature request versions: +Python 2.7 -Python 2.5 ___ Python tracker ___ _