From 152227b569c3a9b87fe0483706f704762ced6d75 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Thu, 18 May 2023 09:50:47 +0530 Subject: gh-103606: Improve error message from logging.config.FileConfig (GH-103628) --- Doc/library/logging.config.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Doc/library') diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst index 8f0b833f85..452832f26a 100644 --- a/Doc/library/logging.config.rst +++ b/Doc/library/logging.config.rst @@ -87,6 +87,10 @@ in :mod:`logging` itself) and defining handlers which are declared either in provides a mechanism to present the choices and load the chosen configuration). + It will raise :exc:`FileNotFoundError` if the file + doesn't exist and :exc:`ValueError` if the file is invalid or + empty. + :param fname: A filename, or a file-like object, or an instance derived from :class:`~configparser.RawConfigParser`. If a ``RawConfigParser``-derived instance is passed, it is used as @@ -126,6 +130,10 @@ in :mod:`logging` itself) and defining handlers which are declared either in .. versionadded:: 3.10 The *encoding* parameter is added. + .. versionadded:: 3.12 + An exception will be thrown if the provided file + doesn't exist or is invalid or empty. + .. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None) Starts up a socket server on the specified port, and listens for new -- cgit v1.2.1