Author irmen
Recipients akuchling, exarkun, irmen, loewis
Date 2010-04-05.17:58:20
SpamBayes Score 4.93e-11
Marked as misclassified No
Message-id <>
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 recvall() release the data and raise an error, or to let it return the partial data? Either way, I think the behavior should be the same regardless of MSG_WAITALL being available. This is not yet the case.

Why C: this started out by making the (very) old patch that I once wrote for socketmodule.c up to date with the current codebase, and taking Martin's comments into account.
The old patch was small and straightforward. Unfortunately the new one turned out bigger and more complex than I thought. For instance I'm not particularly happy with the way recvall returns the partial data on fail. It uses a new exception for that but the code has some trickery to replace the socket.error exception that is initially raised. I'm not sure if my code is the right way to do this, it needs some review. I do think that putting it into the exception object is the only safe way of returning it to the application, unless the semantics on error are changed as mentioned above. Maybe it could be made simpler then.
In any case, it probably is a good idea to see if a pure python solution (perhaps just some additions to Lib/ would be better. Will put some effort into this.
Date User Action Args
2010-04-05 17:58:23irmensetrecipients: + irmen, loewis, akuchling, exarkun
2010-04-05 17:58:23irmensetmessageid: <>
2010-04-05 17:58:21irmenlinkissue1103213 messages
2010-04-05 17:58:21irmencreate