Issue 11831: "pydoc -w" causes "no Python documentation found" error when the path is not current directory (original) (raw)

Issue11831

Created on 2011-04-12 00:42 by susam, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
pydoc-27-syspath.diff susam,2011-04-12 00:46 One line fix for "no Python documentation found" error.
Messages (4)
msg133557 - (view) Author: Susam Pal (susam) Date: 2011-04-12 00:42
Steps to reproduce: susam@nifty:~/pydoc-test$ tree ../pydoc-subject/ ../pydoc-subject/ |-- calc -- formulae.py `-- __init__.py -- config.py -- default.conf -- main.py `-- spal.conf 1 directory, 6 files susam@nifty:~/pydoc-test$ pydoc -w ../pydoc-subject/ no Python documentation found for 'calc' no Python documentation found for 'config' no Python documentation found for 'main'
msg133558 - (view) Author: Susam Pal (susam) Date: 2011-04-12 00:46
Attached a one line fix that fixes this issue. susam@nifty:~/pydoc-test$ pydoc -w ../pydoc-subject/ wrote calc.html wrote calc.formulae.html wrote config.html wrote main.html susam@nifty:~/pydoc-test$ ls calc.formulae.html calc.html config.html main.html Diff: --- /usr/lib/python2.7/pydoc.py.original 2011-04-12 04:56:19.000000000 +0530 +++ /usr/lib/python2.7/pydoc.py 2011-04-12 05:37:20.000000000 +0530 @@ -2299,6 +2299,7 @@ if ispath(arg) and os.path.isfile(arg): arg = importfile(arg) if writing: + sys.path.insert(0, arg) if ispath(arg) and os.path.isdir(arg): writedocs(arg) else:
msg379327 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2020-10-22 19:39
pydoc help: pydoc -w ... Write out the HTML documentation for a module to a file in the current directory. […] So there is no support for not using the current directory, probably on purpose in order to use the current-dir-in-sys.path trick, so I’m not sure if this should be addressed. (These days I would be more worried about src directories, which I’ve just tested are not handled well by pydoc, but that would be a different ticket.)
msg411595 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-25 14:30
Closed Issue31305 as a duplicate of this.
History
Date User Action Args
2022-04-11 14:57:16 admin set github: 56040
2022-01-25 14:30:12 iritkatriel set nosy: + iritkatrielmessages: + versions: + Python 3.9, Python 3.10, Python 3.11, - Python 2.7, Python 3.2
2022-01-25 14:29:52 iritkatriel link issue31305 superseder
2020-10-22 19:39:36 eric.araujo set messages: +
2011-04-15 17:00:16 eric.araujo set nosy: + ron_adam, eric.araujotitle: "python -w" causes "no Python documentation found" error when the path is not current directory -> "pydoc -w" causes "no Python documentation found" error when the path is not current directory
2011-04-12 00:46:53 susam set files: + pydoc-27-syspath.diffkeywords: + patchmessages: +
2011-04-12 00:42:44 susam create