This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: pydoc in web server mode tails at initial request
Type: behavior Stage: resolved
Components: Demos and Tools Versions: Python 3.0
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: alexandre.vassalotti, amaury.forgeotdarc, prologic
Priority: critical Keywords: needs review, patch

Created on 2008-10-01 06:24 by prologic, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
pkgutil.patch amaury.forgeotdarc, 2008-10-01 08:59
Messages (3)
msg74116 - (view) Author: James Mills (prologic) Date: 2008-10-01 06:24
Trying to use pydoc in it's webserver mode fails:

$ pydoc3.0 -p 8000
pydoc server ready at http://localhost:8000/
Exception happened during processing of request from ('', 42939)
Traceback (most recent call last):
  File "/usr/lib/python3.0/", line 281, in
    self.process_request(request, client_address)
  File "/usr/lib/python3.0/", line 307, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.0/", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.0/", line 614, in __init__
  File "/usr/lib/python3.0/http/", line 363, in handle
  File "/usr/lib/python3.0/http/", line 357, in handle_one_request
  File "/usr/lib/python3.0/", line 1957, in do_GET
    indices.append(html.index(dir, seen))
  File "/usr/lib/python3.0/", line 929, in index
    for importer, name, ispkg in pkgutil.iter_modules([dir]):
  File "/usr/lib/python3.0/", line 147, in iter_modules
    for name, ispkg in iter_importer_modules(i, prefix):
  File "/usr/lib/python3.0/", line 325, in iter_zipimport_modules
AttributeError: 'dict_keys' object has no attribute 'sort'
pydoc server stopped
msg74120 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-10-01 08:59
The problem occurs when sys.path contains the name of an existing zip file.

Here is a patch, with tests.
msg90144 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2009-07-05 06:49
Committed in r73856.
Date User Action Args
2022-04-11 14:56:39adminsetgithub: 48255
2009-07-05 06:49:04alexandre.vassalottisetstatus: open -> closed

nosy: + alexandre.vassalotti
messages: + msg90144

resolution: accepted
stage: resolved
2008-10-01 08:59:30amaury.forgeotdarcsetpriority: critical
keywords: + needs review, patch
messages: + msg74120
files: + pkgutil.patch
nosy: + amaury.forgeotdarc
2008-10-01 06:24:49prologiccreate