geopython/OWSLib — pull request #165 by TobiasKipp (2014-07-09 08:28:58+00:00)
Title: Added a workaround for race conditions with files.

Issue:
In my case a read and write race condition between OWSLib client and PyWPS server.
Server: The file is (re)created empty. (like with f = open(filename, "w"))
Client: Due to an unlucky timed request the url is opened has an empty body.
Server: Writes the data into the file.
Client: Still only knows the empty file and the evaluation with lxml will throw an exception.

Solution:
Take some more tries to get a non-empty body. To avoid a deadlock the total sleep time between
re-requests should not exceed the timelimit, currently set to 10 seconds.