Message322235
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 |
|
Date |
User |
Action |
Args |
2018-07-23 17:46:26 | Preston Moore | set | recipients:
+ Preston Moore, vstinner, giampaolo.rodola, zach.ware |
2018-07-23 17:46:26 | Preston Moore | set | messageid: <1532367986.24.0.56676864532.issue30400@psf.upfronthosting.co.za> |
2018-07-23 17:46:26 | Preston Moore | link | issue30400 messages |
2018-07-23 17:46:26 | Preston Moore | create | |
|