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 exarkun
Recipients brian.curtin, exarkun, giampaolo.rodola, paul.moore, pitrou, r.david.murray, tim.golden, trent, vinay.sajip
Date 2010-05-04.15:49:10
SpamBayes Score 0.00029075018
Marked as misclassified No
Message-id <1272988153.33.0.634426659091.issue8576@psf.upfronthosting.co.za>
In-reply-to
Content
> You mean that socket.create_connection(), httplib (issue 3972) and ftplib (issue 8594) should have used a different API to implement their "source_address" option?

I'm not sure what you mean.  The problem here is that you cannot reliably bind a specific local address because it might be bound already.

This is bad in unit tests because it causes spurious failures that waste developer effort forcing people to investigate non-bugs or because it causes people to ignore the results of the test suite.

This is bad in real applications because it prevents an application from working as it is supposed to.

Perhaps you have an application which requires that HTTP requests are issued from (1.2.3.4, 12345).  Then you'd better use an HTTP client library that lets you bind to this address when connecting to the HTTP server.  But the application is going to be prone to failure.  If you can't get around the requirement, then you just get to live with an unreliable application.

There's no such requirement in any unit test, though.  Unit tests can do whatever they want in order to achieve the goal of exercising the relevant implementation code and verify the results to be correct.  I don't think there are any unit tests which need to bind to one specific address in order to accomplish this goal.
History
Date User Action Args
2010-05-04 15:49:13exarkunsetrecipients: + exarkun, paul.moore, vinay.sajip, pitrou, giampaolo.rodola, tim.golden, trent, r.david.murray, brian.curtin
2010-05-04 15:49:13exarkunsetmessageid: <1272988153.33.0.634426659091.issue8576@psf.upfronthosting.co.za>
2010-05-04 15:49:11exarkunlinkissue8576 messages
2010-05-04 15:49:10exarkuncreate