[Python-bugs-list] [ python-Bugs-586931 ] pydoc -w fails with path specified

noreply@sourceforge.net noreply@sourceforge.net
Thu, 08 Aug 2002 18:17:46 -0700


Bugs item #586931, was opened at 2002-07-26 06:31
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=586931&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
>Assigned to: Ka-Ping Yee (ping)
Summary: pydoc -w fails with path specified

Initial Comment:
[from http://bugs.debian.org/143462]

If I specify a path (ie, ./dictclient.py) and use -w, it will 
fail.  If -w
is not used, or a module (ie, dictclient) is specified, it 
will work. 
Example:

$ pydoc2.2 -w ./dictclient.py
Traceback (most recent call last):
  File "/usr/bin/pydoc2.2", line 4, in ?
    pydoc.cli()
  File "/usr/lib/python2.2/pydoc.py", line 2074, in cli
    writedoc(arg)
  File "/usr/lib/python2.2/pydoc.py", line 1345, in writedoc
    object = locate(key, forceload)
  File "/usr/lib/python2.2/pydoc.py", line 1297, in locate
    parts = split(path, '.')
  File "/usr/lib/python2.2/string.py", line 117, in split
    return s.split(sep, maxsplit)
AttributeError: 'module' object has no attribute 'split'


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-08-08 21:17

Message:
Logged In: YES 
user_id=31435

Ping, if you're there, would you please take a look at this?  I 
didn't even know pydoc had a -w argument <0.9 wink> ...

----------------------------------------------------------------------

Comment By: Matthias Klose (doko)
Date: 2002-08-07 16:22

Message:
Logged In: YES 
user_id=60903

sorry for attaching the patch here (submitted on 
http://bugs.debian.org/143462)

[problem is found in 2.1, 2,2 and 2.3]

--- pydoc.py.old        Wed Aug  7 15:52:08 2002 
+++ pydoc.py    Wed Aug  7 15:51:10 2002 
@@ -1114,6 +1114,8 @@                
  
 def writedoc(key, forceload=0):                               
     """Write HTML documentation to a file in the current 
directory.""" 
+    if not isinstance(key, type('')):                      
+        key = key.__name__ 
     try: 
         object = locate(key, forceload) 
     except ErrorDuringImport, value: 


----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-08-07 11:28

Message:
Logged In: YES 
user_id=3066

Tim is friends with pydoc.  ;-)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=586931&group_id=5470