[issue35216] misleading error message from shutil.copy()

Stéphane Wirtel report at bugs.python.org
Mon Nov 12 09:59:28 EST 2018


Stéphane Wirtel <stephane at wirtel.be> added the comment:

This error is specific to the C-API and not to Python,

here is an example.

#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>

int main(int argc, char **argv, char **environ) {
    int fd;
    fd = open("/tmp/toto/", O_CREAT);
    printf("file descriptor: %d\n", fd);
    printf(strerror(errno));
    close(fd);
    return 0;
}



./a.out
file descriptor: -1
Is a directory

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35216>
_______________________________________


More information about the Python-bugs-list mailing list