[New-bugs-announce] [issue2639] shutil.copyfile() documentation is vague

Roy Smith report at bugs.python.org
Tue Apr 15 18:11:06 CEST 2008

New submission from Roy Smith <roy at panix.com>:

The current doc says, "Copy the contents of the file named src to a file 
named dst".  Anybody used to the unix shell "cp" command would assume that 
dst could be a directory, in which case the true destination is a file in 
that directory with the same basename as src.  Experimentation shows that 
this is not true.  A note something like the following would help:

Note: unlike the "cp" shell command, dst may not be a directory; it must 
be a path to a file in that directory.

True, there's no place in the docs which actually says a directory is 
valid for dst, but the name of the module is shutil, so it's reasonable 
for people to assume that these act the same way as the corresponding unix 
shell commands.  It should be stated up front that this is not true, to 
avoid confusion.

assignee: georg.brandl
components: Documentation
messages: 65521
nosy: georg.brandl, roysmith
severity: normal
status: open
title: shutil.copyfile() documentation is vague
versions: Python 2.5

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list