Skip to content

TypeError: argument of type '_SentinelObject' is not iterable (unittest.mock) #753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bryant-finney opened this issue Oct 22, 2024 · 0 comments · Fixed by #754
Closed

TypeError: argument of type '_SentinelObject' is not iterable (unittest.mock) #753

bryant-finney opened this issue Oct 22, 2024 · 0 comments · Fixed by #754
Labels

Comments

@bryant-finney
Copy link
Contributor

Problem Description

pdoc fails to generate API documentation for the unittest.mock module.

Steps to reproduce the behavior:

pdoc --output-directory /tmp/docs unittest.mock
Traceback (most recent call last):
  File "/private/tmp/pdoc/.venv/bin/pdoc", line 8, in <module>
    ...
  File "/Users/bf/.pyenv/versions/3.13.0/lib/python3.13/functools.py", line 1037, in __get__
    val = self.func(instance)
  File "/private/tmp/pdoc/.venv/lib/python3.13/site-packages/pdoc/doc.py", line 259, in members
    taken_from = self._taken_from(name, obj)
  File "/private/tmp/pdoc/.venv/lib/python3.13/site-packages/pdoc/doc.py", line 448, in _taken_from
    if mod and qual and "<locals>" not in qual:
                        ^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type '_SentinelObject' is not iterable

System Information

❯ pdoc --version
pdoc: 15.0.0
Python: 3.13.0
Platform: macOS-14.6.1-arm64-arm-64bit-Mach-O
bryant-finney added a commit to bryant-finney/pdoc that referenced this issue Oct 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Signed-off-by: Bryant Finney <bryant.finney@outlook.com>
bryant-finney added a commit to bryant-finney/pdoc that referenced this issue Oct 23, 2024
... by checking for the `__contains__` attribute

Signed-off-by: Bryant Finney <bryant.finney@outlook.com>
bryant-finney added a commit to config-ninja/config-ninja that referenced this issue Oct 23, 2024
mitmproxy/pdoc#753

Signed-off-by: Bryant Finney <bryant.finney@outlook.com>
bryant-finney added a commit to bryant-finney/pdoc that referenced this issue Oct 23, 2024
... from @mhils during mitmproxy#754

Signed-off-by: Bryant Finney <bryant.finney@outlook.com>
bryant-finney added a commit to bryant-finney/pdoc that referenced this issue Oct 23, 2024
... from @mhils during mitmproxy#754

Signed-off-by: Bryant Finney <bryant.finney@outlook.com>
mhils pushed a commit that referenced this issue Oct 23, 2024
* fix(#753): add failing test

Signed-off-by: Bryant Finney <bryant.finney@outlook.com>

* fix(#753): avoid `TypeError`s

... by checking for the `__contains__` attribute

Signed-off-by: Bryant Finney <bryant.finney@outlook.com>

* fix(#753): Apply suggestion

... from @mhils during #754

Signed-off-by: Bryant Finney <bryant.finney@outlook.com>

---------

Signed-off-by: Bryant Finney <bryant.finney@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant