Author martin.panter
Recipients StyXman, christian.heimes, martin.panter, neologix, vstinner
Date 2016-04-27.10:39:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
FYI Martin Panter and vadmium are both me :)

I’m not a big fan or expert on and Autoconf, but I guess in this case it is the simplest solution. Maybe look at some of the existing AC_CHECK_DECL and AC_COMPILE_IFELSE invocations. I guess you need to see if __NR_copy_file_range is available.

In the earlier patches, there were four space characters at the start of the file. In the 2016-04-27 09:16 patch, there is a completely empty line (after +#endif /* HAVE_COPY_FILE_RANGE */), which may also be interfering.

FWIW, I don’t think you have to have the posix_ prefix on your function if you don’t want it. It is a static function, so the naming is fairly unrestricted.

About changing copyfileobj(), here are some test cases which may help explain the compatibility problems:

# Transcoding a file to a different character encoding
with open("input.txt", "rt", encoding="latin-1") as input, \
        open("utf8.txt", "wt", encoding="utf-8") as output:
    shutil.copyfileobj(input, output)

# Input is a BufferedReader and may hold extra buffered data
with open("data", "rb") as input, open("output", "wb") as output:
    header =  # Actually reads more bytes from OS
    copyfileobj(input, output)  # Copy starting from offset 100
Date User Action Args
2016-04-27 10:39:40martin.pantersetrecipients: + martin.panter, vstinner, christian.heimes, StyXman, neologix
2016-04-27 10:39:40martin.pantersetmessageid: <>
2016-04-27 10:39:40martin.panterlinkissue26826 messages
2016-04-27 10:39:39martin.pantercreate