This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Preston Moore
Recipients Preston Moore, giampaolo.rodola, vstinner, zach.ware
Date 2018-07-23.17:46:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532367986.24.0.56676864532.issue30400@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-07-23 17:46:26Preston Mooresetrecipients: + Preston Moore, vstinner, giampaolo.rodola, zach.ware
2018-07-23 17:46:26Preston Mooresetmessageid: <1532367986.24.0.56676864532.issue30400@psf.upfronthosting.co.za>
2018-07-23 17:46:26Preston Moorelinkissue30400 messages
2018-07-23 17:46:26Preston Moorecreate