This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ehohenstein
Recipients Ben.Smith, ehohenstein, exarkun, giampaolo.rodola, gregory.p.smith, neologix, pitrou
Date 2010-12-22.18:12:51
SpamBayes Score 2.0539126e-15
Marked as misclassified No
Message-id <1293041577.53.0.941486265639.issue9090@psf.upfronthosting.co.za>
In-reply-to
Content
I have ported the changes related to this problem from the 3.2 branch to the 2.6 version of socketmodule.c. The changes are attached as a diff from Python 2.6.2. The changes apply to all platforms but I've only tested them on Windows.

The _PyTime_gettimeofday method is not available in 2.6 which is why the changes in 3.2 weren't originally back ported. I admit to adding a disgusting hack which was to copy some of the _PyTime_gettimeofday interface code from 3.2 to the socketmodule.c file and implement it using the time.time() method, falling back to the crt time() method. It's not as efficient as the implementation in 3.2 but I believe it should be equally correct.

The motivation for doing this was that I continued to see 10035 errors happening using Python 2.6 though in different code paths. Specifically, errors were being thrown when uploading a file using a PUT request using httplib which calls sendall(). It's noteworthy that analysing the changes made for this issue to Python 3.2 revealed that no change was made to the sendall() method. sendall() is actually problematic in that the timeout on the socket may actually be exceeded without error if any one call to select() doesn't exceed the socket's timeout but in aggregate the calls to select do wait longer than the timeout. The same generic solution that was applied to the other socket methods is not appropriate for sendall(). I elected to continue this behavior by just checking for EAGAIN and EWOULDBLOCK if the socket has a positive timeout value and the call to send failed and continuing the select/send loop in that case. As far as I can tell, sendall() will still fail with these recoverable errors in Python 3.2. I won't feel bad if this patch is rejected for 2.6 but the changes to sendall() should really be considered for the 3.2 branch.
History
Date User Action Args
2010-12-22 18:12:57ehohensteinsetrecipients: + ehohenstein, gregory.p.smith, exarkun, pitrou, giampaolo.rodola, neologix, Ben.Smith
2010-12-22 18:12:57ehohensteinsetmessageid: <1293041577.53.0.941486265639.issue9090@psf.upfronthosting.co.za>
2010-12-22 18:12:52ehohensteinlinkissue9090 messages
2010-12-22 18:12:51ehohensteincreate