summaryrefslogtreecommitdiff
path: root/Doc/library/shutil.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-14 19:18:39 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-14 19:18:39 +0200
commita566549211d48775b6573e74dc55dd0fcde0600b (patch)
tree4d22ddea7465a167b3532578b4e9719628944a6a /Doc/library/shutil.rst
parent2f64ebcf0395bd3ee8cf4a8a1e74c73f1c5ab3c4 (diff)
parentef41f59e7544eae3e38815a5c8bc8f5a944d0b13 (diff)
downloadcpython-a566549211d48775b6573e74dc55dd0fcde0600b.tar.gz
Issue #17919: Fixed integer overflow in the eventmask parameter.
Diffstat (limited to 'Doc/library/shutil.rst')
-rw-r--r--Doc/library/shutil.rst22
1 files changed, 17 insertions, 5 deletions
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index a1457d070b..e4f348cd82 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -53,7 +53,7 @@ Directory and files operations
*dst* and return *dst*. *src* and *dst* are path names given as strings.
*dst* must be the complete target file name; look at :func:`shutil.copy`
for a copy that accepts a target directory path. If *src* and *dst*
- specify the same file, :exc:`Error` is raised.
+ specify the same file, :exc:`SameFileError` is raised.
The destination location must be writable; otherwise, an :exc:`OSError`
exception will be raised. If *dst* already exists, it will be replaced.
@@ -69,6 +69,19 @@ Directory and files operations
Added *follow_symlinks* argument.
Now returns *dst*.
+ .. versionchanged:: 3.4
+ Raise :exc:`SameFileError` instead of :exc:`Error`. Since the former is
+ a subclass of the latter, this change is backward compatible.
+
+
+.. exception:: SameFileError
+
+ This exception is raised if source and destination in :func:`copyfile`
+ are the same file.
+
+ .. versionadded:: 3.4
+
+
.. function:: copymode(src, dst, *, follow_symlinks=True)
Copy the permission bits from *src* to *dst*. The file contents, owner, and
@@ -380,11 +393,10 @@ provided by this module. ::
errors.extend(err.args[0])
try:
copystat(src, dst)
- except WindowsError:
- # can't copy file access times on Windows
- pass
except OSError as why:
- errors.extend((src, dst, str(why)))
+ # can't copy file access times on Windows
+ if why.winerror is None:
+ errors.extend((src, dst, str(why)))
if errors:
raise Error(errors)