[issue15343] "pydoc -w <package>" writes out page with empty "Package Contents" section

Nick Coghlan report at bugs.python.org
Sun Jul 15 13:53:50 CEST 2012


Nick Coghlan <ncoghlan at gmail.com> added the comment:

Fixing this has uncovered another issue: the old import emulation in PEP 302 ignored encoding cookies, thus merrily decoding everything as utf-8 in "get_source()". importlib is smarter about this, which means the pydoc tests started failing as they tried to load the files with invalid encoding cookies.

I plan to tackle this in two parts:

- move get_source() and get_code() in importlib towards consistently raising ImportError, regardless of the reason the result couldn't be provided (chaining the exceptions to ensure details aren't lost)

- update pydoc to tolerate ImportError from get_source.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15343>
_______________________________________


More information about the Python-bugs-list mailing list