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

Julien Palard report at bugs.python.org
Mon Nov 12 16:51:08 EST 2018


Julien Palard <julien+python at palard.fr> added the comment:

Using `cp` on Debian Buster I'm having a better error message:

    $ touch foo
    $ cp foo bar/
    cp: failed to access 'bar/': Not a directory

>From copy.c (from Debian coreutils):

    /* Improve quality of diagnostic when a nonexistent dst_name
       ends in a slash and open fails with errno == EISDIR.  */
    if (dest_desc < 0 && dest_errno == EISDIR
        && *dst_name && dst_name[strlen (dst_name) - 1] == '/')
      dest_errno = ENOTDIR;

----------
nosy: +mdk

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


More information about the Python-bugs-list mailing list