Commit 510da574 by rfkelly0

more transient error recovery in TempFS.close()

parent e4ea9df6
...@@ -38,10 +38,12 @@ class TempFS(OSFS): ...@@ -38,10 +38,12 @@ class TempFS(OSFS):
Python. Note that once this method has been called, the FS object may Python. Note that once this method has been called, the FS object may
no longer be used. no longer be used.
""" """
# Depending on how resources are freed by the OS, there could
# be some transient errors when freeing a TempFS soon after it
# was used. If they occur, do a small sleep and try again.
try: try:
self._close() self._close()
except ResourceLockedError: except (ResourceLockedError,ResourceInvalidError):
# Give win32 a chance to clean up after itself
time.sleep(0.5) time.sleep(0.5)
self._close() self._close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment