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 martin.panter
Recipients earl.chew, martin.panter
Date 2016-07-26.00:17:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469492270.71.0.0462390669055.issue27614@psf.upfronthosting.co.za>
In-reply-to
Content
I don’t understand why we have so many tests that assign the server port in the server thread, and then use some sort of synchronization to get it to the client thread. IMO it would be simpler in this case to do something like:

def setUp(self):
    serv = DOCXMLRPCServer(...)
    self.addCleanup(serv.server_close)
    [_, PORT] = serv.server_address  # Eliminates “ready“ event
    # Other server setup here
    thread = threading.Thread(target=serv.serve_forever)
    thread.start()
    self.addCleanup(thread.join)  # Instead of self.evt
    self.addCleanup(serv.shutdown)
    self.client = httplib.HTTPConnection("localhost:%d" % PORT)
    self.addCleanup(self.client.close)
History
Date User Action Args
2016-07-26 00:17:50martin.pantersetrecipients: + martin.panter, earl.chew
2016-07-26 00:17:50martin.pantersetmessageid: <1469492270.71.0.0462390669055.issue27614@psf.upfronthosting.co.za>
2016-07-26 00:17:50martin.panterlinkissue27614 messages
2016-07-26 00:17:46martin.pantercreate