Author vstinner
Recipients giampaolo.rodola, pablogsal, vstinner
Date 2019-06-05.10:00:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559728825.05.0.0727633791363.issue37157@roundup.psfhosted.org>
In-reply-to
Content
cow.diff: I'm not sure that attempt to call unlink() if FICLONE fails is a good idea. unlink() can raise a new exception which can be confusing. IMHO it's up to the caller to deal with that. Said differently, I dislike the *fallback* parameter of reflink().

Why not exposing clonefile() as os.clonefile() but os._clonefile()?

+#if defined(MAC_OS_X_VERSION_10_12)
+#include <sys/clonefile.h>
+#define HAVE_CLONEFILE
+#endif

Is Python compiled to target macOS 10.12 and newer? Mac/BuildScript/build-installer.py contains:

# $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
DEPTARGET = '10.5'

But I don't know well macOS. "#if defined(MAC_OS_X_VERSION_10_12)" is a check at build time. Does it depend on DEPTARGET? Would it be possible to use a runtime check?

You might open a dedicated issue to expose clonefile() since it seems like every tiny detail of this issue is very subtle and should be properly discussed ;-) (I like the idea of exposing native functions like clonefile() directly in the os module!)
History
Date User Action Args
2019-06-05 10:00:25vstinnersetrecipients: + vstinner, giampaolo.rodola, pablogsal
2019-06-05 10:00:25vstinnersetmessageid: <1559728825.05.0.0727633791363.issue37157@roundup.psfhosted.org>
2019-06-05 10:00:25vstinnerlinkissue37157 messages
2019-06-05 10:00:24vstinnercreate