The problem is with the suds library itself. In cache.py, although ObjectCache.get() always gets a valid file pointer, it removes the exception (EOFError) that executes pickle.load(fp) . When this happens, the file will download again.
Here's the sequence of events:
DocumentReader.open ():
Therefore, it does not matter that the new cache file has been saved, because the same thing happens the next time you start. This happens for ALL WSDL and XSD files.
I fixed this problem by opening the cache file in binary mode while reading and writing. In particular, the changes I made were in cache.py:
1) In FileCache.put() change this line:
f = self.open(fn, 'w')
to
f = self.open(fn, 'wb')
2) In FileCache.getf() change this line:
return self.open(fn)
to
return self.open(fn, 'rb')
I donβt know the code well enough to know if these changes are safe, but it pulls objects from the file cache, the service still works successfully, and the client download went from 16 seconds down to 2.5 seconds . Much better if you ask me.
We hope that this correction or something similar can be introduced back into the main line of foam. I already sent this to the foam mailing list (fedora-suds-list in redhat dot com).
source share