Replaced `FileAlreadyExistsError` with the shorter `FileExistsError`
(thanks Georg)
This commit is contained in:
parent
b840946b96
commit
8fb8f70c6d
10
pep-3151.txt
10
pep-3151.txt
|
@ -330,8 +330,8 @@ New exception classes
|
||||||
The following tentative list of subclasses, along with a description and
|
The following tentative list of subclasses, along with a description and
|
||||||
the list of errnos mapped to them, is submitted to discussion:
|
the list of errnos mapped to them, is submitted to discussion:
|
||||||
|
|
||||||
* ``FileAlreadyExistsError``: trying to create a file or directory which
|
* ``FileExistsError``: trying to create a file or directory which already
|
||||||
already exists (EEXIST)
|
exists (EEXIST)
|
||||||
|
|
||||||
* ``FileNotFoundError``: for all circumstances where a file and directory is
|
* ``FileNotFoundError``: for all circumstances where a file and directory is
|
||||||
requested but doesn't exist (ENOENT)
|
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``,
|
* ``ConnectionError``: a base class for ``ConnectionAbortedError``,
|
||||||
``ConnectionRefusedError`` and ``ConnectionResetError``
|
``ConnectionRefusedError`` and ``ConnectionResetError``
|
||||||
|
|
||||||
* ``FileSystemError``: a base class for ``FileAlreadyExistsError``,
|
* ``FileSystemError``: a base class for ``FileExistsError``,
|
||||||
``FileNotFoundError``, ``IsADirectoryError`` and ``NotADirectoryError``
|
``FileNotFoundError``, ``IsADirectoryError`` and ``NotADirectoryError``
|
||||||
|
|
||||||
The following drawing tries to sum up the proposed additions, along with
|
The following drawing tries to sum up the proposed additions, along with
|
||||||
|
@ -383,7 +383,7 @@ shown::
|
||||||
+-- ConnectionResetError ECONNRESET
|
+-- ConnectionResetError ECONNRESET
|
||||||
+-- FileDescriptorError EBADF
|
+-- FileDescriptorError EBADF
|
||||||
+-- FileSystemError
|
+-- FileSystemError
|
||||||
+-- FileAlreadyExistsError EEXIST
|
+-- FileExistsError EEXIST
|
||||||
+-- FileNotFoundError ENOENT
|
+-- FileNotFoundError ENOENT
|
||||||
+-- IsADirectoryError EISDIR
|
+-- IsADirectoryError EISDIR
|
||||||
+-- NotADirectoryError ENOTDIR
|
+-- NotADirectoryError ENOTDIR
|
||||||
|
@ -396,7 +396,7 @@ Naming
|
||||||
Various naming controversies can arise. One of them is whether all
|
Various naming controversies can arise. One of them is whether all
|
||||||
exception class names should end in "``Error``". In favour is consistency
|
exception class names should end in "``Error``". In favour is consistency
|
||||||
with the rest of the exception hiearchy, against is concision (especially
|
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
|
Another cosmetic issue is whether ``FileSystemError`` should be spelled
|
||||||
``FilesystemError`` instead.
|
``FilesystemError`` instead.
|
||||||
|
|
Loading…
Reference in New Issue