Skip to content

Commit

Permalink
BUG: Added UnicodeDecodeError to list of expected exceptions in _pep2…
Browse files Browse the repository at this point in the history
…24_docstrings() (#396)

Co-authored-by: Frank Pecher <[email protected]>
  • Loading branch information
frank101010 and Frank Pecher authored Mar 11, 2024
1 parent 96e9155 commit cf5bffd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def _pep224_docstrings(doc_obj: Union['Module', 'Class'], *,
# before using cleaned doc_obj.source
_ = inspect.findsource(doc_obj.obj)
tree = ast.parse(doc_obj.source)
except (OSError, TypeError, SyntaxError) as exc:
except (OSError, TypeError, SyntaxError, UnicodeDecodeError) as exc:
# Don't emit a warning for builtins that don't have source available
is_builtin = getattr(doc_obj.obj, '__module__', None) == 'builtins'
if not is_builtin:
Expand Down

0 comments on commit cf5bffd

Please sign in to comment.