[Python-checkins] cpython: Mention specific exceptions instead of OSError where appropriate.

antoine.pitrou python-checkins at python.org
Mon Dec 16 21:00:59 CET 2013


http://hg.python.org/cpython/rev/6fb4227dba6a
changeset:   88005:6fb4227dba6a
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Mon Dec 16 21:00:53 2013 +0100
summary:
  Mention specific exceptions instead of OSError where appropriate.

files:
  Doc/library/pathlib.rst |  7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -765,14 +765,15 @@
 
    Create a new directory at this given path.  If *mode* is given, it is
    combined with the process' ``umask`` value to determine the file mode
-   and access flags.  If the path already exists, :exc:`OSError` is raised.
+   and access flags.  If the path already exists, :exc:`FileExistsError`
+   is raised.
 
    If *parents* is true, any missing parents of this path are created
    as needed; they are created with the default permissions without taking
    *mode* into account (mimicking the POSIX ``mkdir -p`` command).
 
    If *parents* is false (the default), a missing parent raises
-   :exc:`OSError`.
+   :exc:`FileNotFoundError`.
 
 
 .. method:: Path.open(mode='r', buffering=-1, encoding=None, errors=None, newline=None)
@@ -879,7 +880,7 @@
    with the process' ``umask`` value to determine the file mode and access
    flags.  If the file already exists, the function succeeds if *exist_ok*
    is true (and its modification time is updated to the current time),
-   otherwise :exc:`OSError` is raised.
+   otherwise :exc:`FileExistsError` is raised.
 
 
 .. method:: Path.unlink()

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list