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 gregory.p.smith
Recipients georg.brandl, gregory.p.smith, loewis, techtonik
Date 2009-02-18.05:48:58
SpamBayes Score 0.00010078269
Marked as misclassified No
Message-id <1234936142.65.0.254377822784.issue5293@psf.upfronthosting.co.za>
In-reply-to
Content
Yes it is annoying to have to deal with the different OS specific error
numbers when handling socket.error, OSError, IOError or EnvironmentError
subclasses in general but that is life.  Python does not attempt to
figure out what all possible behaviors and errors are and coerce them
into some common representation because there often is not a common
thing.  Fortunately while there are many network stack behaviors, there
are really only two APIs (posix and windows) so there are only two sets
of error numbers to check for.  The burden is not that great in cross
platform code.

The issue that prompted this bug report: calling socket.connect() once
is not and has never been a way to wait for a server on the network to
come up.  If the server isn't there at the time it was called, it will
return an error once the OS has decided that it has no way to connect. 
The absense of a timeout being specified does not imply that it will
retry the underlying system call for you.  Merely that it won't bail out
early.

I have updated the socket module documentation to clarify this a bit in
r69731.
History
Date User Action Args
2009-02-18 05:49:02gregory.p.smithsetrecipients: + gregory.p.smith, loewis, georg.brandl, techtonik
2009-02-18 05:49:02gregory.p.smithsetmessageid: <1234936142.65.0.254377822784.issue5293@psf.upfronthosting.co.za>
2009-02-18 05:49:00gregory.p.smithlinkissue5293 messages
2009-02-18 05:48:58gregory.p.smithcreate