You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least logging the OSError would help understanding what is wrong (in our case it was related to the fact that we had no more inode available in the filesystem).
The text was updated successfully, but these errors were encountered:
Should not we just raise the OSError if the directory does not exist?
I'm not sure: the point of the try: ... except OSError: block is to ensure that the directory exists: if another thread / process has created it, then the function can return normally. I guess we could check the errno of the exception, e.g.:
ifcreateandnotos.path.exists(path):
try:
os.makedirs(path)
exceptOSErrorasexc:
# We might have lost a race. If so, the directory# must exist nowifexc.errno!=errno.EEXIST:
raiseassertos.path.exists(path)
returnpath
While debugging an issue with @pysailor we found that a try/except in
getPathForOID
is masking anOSError
with anAssertionError
:ZODB/src/ZODB/blob.py
Lines 432 to 435 in 8f5ac63
At least logging the
OSError
would help understanding what is wrong (in our case it was related to the fact that we had no more inode available in the filesystem).The text was updated successfully, but these errors were encountered: