Preston Moore <prestonkmo...@gmail.com> added the comment:

Hey everyone,

I have updated the pull request to include a version of copyfile() that 
attempts to address the discussed race condition by open()’ing a file 
descriptor to the relevant files as early as possible and maintaining it 
throughout processing.  In order for this to work I had to use some lower level 
posix-only features. Specifically, I had to open() the files non-blocking 
initially and using fcntl() to make them blocking once some initial checks have 
been performed.  The functions behavior under Windows should be unchanged.  I 
chose this course because Windows doesn’t support fcntl() or os.open() with 
O_NONBLOCK.

I will add a few additional tests around the new checks and get things ready 
for a merge.  I would also be glad to use a strategy of this nature to fix 
similar bugs in the other areas discussed above.

Thanks,
Preston

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue30400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to