From 5796f7574f3eeede46a56d57569ddf40c05f67d6 Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Fri, 4 Apr 2025 10:59:31 +0000 Subject: [PATCH 1/4] Docs: Fix document for `plistlib.load` [The document](https://docs.python.org/3/library/plistlib.html#plistlib.load) states that `plistlib.load` raises `InvalidFileException` if the binary file cannot be parsed. But as of 05ee790f4d1cd8725a90b54268fc1dfe5b4d1fa2, the function now also raises the exception if it cannot parse an XML text file. --- Doc/library/plistlib.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Doc/library/plistlib.rst b/Doc/library/plistlib.rst index ad96be755b8158..f542995d0e14a1 100644 --- a/Doc/library/plistlib.rst +++ b/Doc/library/plistlib.rst @@ -78,8 +78,7 @@ This module defines the following functions: exceptions on ill-formed XML. Unknown elements will simply be ignored by the plist parser. - The parser for the binary format raises :exc:`InvalidFileException` - when the file cannot be parsed. + The parser raises :exc:`InvalidFileException` when the file cannot be parsed. .. versionadded:: 3.4 From f24709a73e74d160f59d8a804818ea9319aa92e1 Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Sat, 5 Apr 2025 00:53:56 +0000 Subject: [PATCH 2/4] Add document for `InvalidFileException` --- Doc/library/plistlib.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/library/plistlib.rst b/Doc/library/plistlib.rst index f542995d0e14a1..a8d0d48f2d8626 100644 --- a/Doc/library/plistlib.rst +++ b/Doc/library/plistlib.rst @@ -169,6 +169,16 @@ The following constants are available: .. versionadded:: 3.4 +The following exceptions are available: + +.. exception:: InvalidFileException + + Raised by plist file parser functions (e.g. :func:`load`) + when the file cannot be parsed. + + .. versionadded:: 3.4 + + Examples -------- From e4102e5ac3a4c7b0c4179744e0fd0451f029338f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sat, 5 Apr 2025 10:40:19 +0200 Subject: [PATCH 3/4] Update Doc/library/plistlib.rst --- Doc/library/plistlib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/plistlib.rst b/Doc/library/plistlib.rst index a8d0d48f2d8626..f2c36542a0814c 100644 --- a/Doc/library/plistlib.rst +++ b/Doc/library/plistlib.rst @@ -169,7 +169,7 @@ The following constants are available: .. versionadded:: 3.4 -The following exceptions are available: +The module defines the following exceptions: .. exception:: InvalidFileException From 23cfb6a6c8842ed3799ea3e017606de936492fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sat, 5 Apr 2025 10:40:43 +0200 Subject: [PATCH 4/4] Update Doc/library/plistlib.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- Doc/library/plistlib.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Doc/library/plistlib.rst b/Doc/library/plistlib.rst index f2c36542a0814c..c3a133e46a64d6 100644 --- a/Doc/library/plistlib.rst +++ b/Doc/library/plistlib.rst @@ -173,8 +173,7 @@ The module defines the following exceptions: .. exception:: InvalidFileException - Raised by plist file parser functions (e.g. :func:`load`) - when the file cannot be parsed. + Raised when a file cannot be parsed. .. versionadded:: 3.4