Ronald Oussoren <[email protected]> added the comment:
If it is reproducable in C this is likely a bug in macOS, and should be
reported to them.
I get the same behaviour as you with the test script, even if I add calls to
fhandle.flush and os.fsync to force the content to stable storage.
Interestingly enough I sometimes get other behaviour that shouldn't happen:
Traceback (most recent call last):
File "/Users/ronald/Downloads/concurrency-tests/test-conc-read.py", line 33,
in <module>
fhandle.flush()
OSError: [Errno 22] Invalid argument
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "concurrency-tests/test-conc-read.py", line 34, in <module>
os.fsync(fhandle.fileno())
OSError: [Errno 22] Invalid argument
This is with the change I wrote about earlier:
except FileNotFoundError:
print(i, ">> DELETED <<")
# Recreate the file
time.sleep(0.001) # Wait a bit
with open(dest_fname, 'wb') as fhandle:
fhandle.write(b'CONTENT')
fhandle.flush()
os.fsync(fhandle.fileno())
This shouldn't happen, "fhandle" is open at this point and hence the low-level
file descriptor should still be valid.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41291>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com