From 8fb8f70c6d5abd6656e1bcd41b1ca2c8a3409e1c Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Fri, 3 Sep 2010 18:32:23 +0000 Subject: [PATCH] Replaced `FileAlreadyExistsError` with the shorter `FileExistsError` (thanks Georg) --- pep-3151.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pep-3151.txt b/pep-3151.txt index a7932d32e..86a0dc45a 100644 --- a/pep-3151.txt +++ b/pep-3151.txt @@ -330,8 +330,8 @@ New exception classes The following tentative list of subclasses, along with a description and the list of errnos mapped to them, is submitted to discussion: -* ``FileAlreadyExistsError``: trying to create a file or directory which - already exists (EEXIST) +* ``FileExistsError``: trying to create a file or directory which already + exists (EEXIST) * ``FileNotFoundError``: for all circumstances where a file and directory is requested but doesn't exist (ENOENT) @@ -368,7 +368,7 @@ In addition, the following exception class are proposed for inclusion: * ``ConnectionError``: a base class for ``ConnectionAbortedError``, ``ConnectionRefusedError`` and ``ConnectionResetError`` -* ``FileSystemError``: a base class for ``FileAlreadyExistsError``, +* ``FileSystemError``: a base class for ``FileExistsError``, ``FileNotFoundError``, ``IsADirectoryError`` and ``NotADirectoryError`` The following drawing tries to sum up the proposed additions, along with @@ -383,7 +383,7 @@ shown:: +-- ConnectionResetError ECONNRESET +-- FileDescriptorError EBADF +-- FileSystemError - +-- FileAlreadyExistsError EEXIST + +-- FileExistsError EEXIST +-- FileNotFoundError ENOENT +-- IsADirectoryError EISDIR +-- NotADirectoryError ENOTDIR @@ -396,7 +396,7 @@ Naming Various naming controversies can arise. One of them is whether all exception class names should end in "``Error``". In favour is consistency with the rest of the exception hiearchy, against is concision (especially -with long names such as ``FileAlreadyExistsError``). +with long names such as ``ConnectionAbortedError``). Another cosmetic issue is whether ``FileSystemError`` should be spelled ``FilesystemError`` instead.