[issue36656] Race conditions due to os.link and os.symlink POSIX specification
Tom Hale
report at bugs.python.org
Mon Jun 3 06:36:04 EDT 2019
Tom Hale <tomnott at gmail.com> added the comment:
Serhiy wrote
> Detected problem is better than non-detected problem.
I agree. I also assert that no problem (via a shutil wrapper) is better than a detected problem which may not be handled.
While it's up to the programmer to handle exceptions, it's only systems programmers who will realise that there is a sometimes-occurring exception which should be handled.
So most people won't handle it. They don't know that they need to.
The shutil os.link and os.symlink wrappers under discussion on python-ideas prevent non-system-programmers from needing to know about the race-condition case (and correctly handling it).
If something is difficult to get right, then let's put it in shutil and save everyone reinventing the wheel.
3 specific cases in which an atomic link replacement would be useful are listed here:
https://code.activestate.com/lists/python-ideas/56195/
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36656>
_______________________________________
More information about the Python-bugs-list
mailing list