pdoc3 / pdoc3/pdoc

Getting exception with Python 3.9 and 0.9.2

Open
#286 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.2k
Forks
146
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

Should work with Python 3.9.

Actual Behavior

Getting exception:

Traceback (most recent call last):
  File "/usr/local/bin/pdoc", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/pdoc/cli.py", line 572, in main
    recursive_write_files(module, ext='.html', **template_config)
  File "/usr/local/lib/python3.9/site-packages/pdoc/cli.py", line 349, in recursive_write_files
    recursive_write_files(submodule, ext=ext, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pdoc/cli.py", line 344, in recursive_write_files
    f.write(m.html(**kwargs))
  File "/usr/local/lib/python3.9/site-packages/pdoc/__init__.py", line 832, in html
    html = _render_template('/html.mako', module=self, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pdoc/__init__.py", line 158, in _render_template
    return t.render(**config).strip()
  File "/usr/local/lib/python3.9/site-packages/mako/template.py", line 476, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/local/lib/python3.9/site-packages/mako/runtime.py", line 878, in _render
    _render_context(
  File "/usr/local/lib/python3.9/site-packages/mako/runtime.py", line 920, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/local/lib/python3.9/site-packages/mako/runtime.py", line 947, in _exec_template
    callable_(context, *args, **kwargs)
  File "_html_mako", line 143, in render_body
  File "_html_mako", line 49, in show_module
  File "_html_mako", line 428, in render_show_module
  File "/usr/local/lib/python3.9/site-packages/pdoc/__init__.py", line 1085, in subclasses
    for c in type.__subclasses__(self.obj))
TypeError: descriptor '__subclasses__' for 'type' objects doesn't apply to a 'types.GenericAlias' object
Steps to Reproduce
  1. git clone https://github.com/dbrattli/Expression.git
  2. cd expression
  3. pdoc --html expression -o docs
Additional info
  • pdoc version: 0.9.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at pdoc/init.py:1085, where subclasses fails, and reproduce with the Expression clone using pdoc --html expression -o docs under Python 3.9. Trace the handling of the types.GenericAlias shown in the traceback and verify that the command completes without the exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.