Skip to content

Commit

Permalink
Document UnicodeDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
nineteendo committed Nov 28, 2024
1 parent 8eb1ecd commit b88c506
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/jsonyx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def read(
:param use_decimal: use :class:`decimal.Decimal` instead of :class:`float`
:raises JSONSyntaxError: if the JSON file is invalid
:raises RecursionError: if the JSON file is too deeply nested
:raises UnicodeDecodeError: when failing to decode the file
:return: a Python object.
Example:
Expand Down Expand Up @@ -160,6 +161,7 @@ def load(
:param use_decimal: use :class:`decimal.Decimal` instead of :class:`float`
:raises JSONSyntaxError: if the JSON file is invalid
:raises RecursionError: if the JSON file is too deeply nested
:raises UnicodeDecodeError: when failing to decode the file
:return: a Python object
Example:
Expand Down Expand Up @@ -199,6 +201,7 @@ def loads(
:param use_decimal: use :class:`decimal.Decimal` instead of :class:`float`
:raises JSONSyntaxError: if the JSON string is invalid
:raises RecursionError: if the JSON string is too deeply nested
:raises UnicodeDecodeError: when failing to decode the string
:return: a Python object
Example:
Expand Down
3 changes: 3 additions & 0 deletions src/jsonyx/_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ def read(self, filename: _StrPath) -> Any:
:param filename: the path to the JSON file
:raises JSONSyntaxError: if the JSON file is invalid
:raises RecursionError: if the JSON file is too deeply nested
:raises UnicodeDecodeError: when failing to decode the file
:return: a Python object
Example:
Expand All @@ -659,6 +660,7 @@ def load(
:param root: the path to the archive containing this JSON file
:raises JSONSyntaxError: if the JSON file is invalid
:raises RecursionError: if the JSON file is too deeply nested
:raises UnicodeDecodeError: when failing to decode the file
:return: a Python object
Example:
Expand All @@ -685,6 +687,7 @@ def loads(
:param filename: the path to the JSON file
:raises JSONSyntaxError: if the JSON string is invalid
:raises RecursionError: if the JSON string is too deeply nested
:raises UnicodeDecodeError: when failing to decode the string
:return: a Python object
Example:
Expand Down

0 comments on commit b88c506

Please sign in to comment.