[Patches] [ python-Patches-514628 ] bug in pydoc on python 2.2 release

noreply@sourceforge.net noreply@sourceforge.net
Sun, 11 Aug 2002 05:27:55 -0700


Patches item #514628, was opened at 2002-02-07 18:09
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=514628&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
>Resolution: Works For Me
Priority: 5
Submitted By: Raj Kunjithapadam (mmaster25)
Assigned to: Ka-Ping Yee (ping)
Summary: bug in pydoc on python 2.2 release

Initial Comment:
pydoc has a bug when trying to generate html doc
more importantly it has bug in the method
writedoc()

attached is my fix.
Here is the diff between my fix and the regular dist

1338c1338
< def writedoc(thing, forceload=0):
---
> def writedoc(key, forceload=0):
1340,1346c1340,1343
<     object = thing
<     if type(thing) is type(''):
<         try:
<             object = locate(thing, forceload)
<         except ErrorDuringImport, value:
<             print value
<             return
---
>     try:
>         object = locate(key, forceload)
>     except ErrorDuringImport, value:
>         print value
1351c1348
<             file = open(thing.__name__ + '.html', 'w')
---
>             file = open(key + '.html', 'w')
1354c1351
<             print 'wrote', thing.__name__ + '.html'
---
>             print 'wrote', key + '.html'
1356c1353
<             print 'no Python documentation found for
%s' % repr(thing)
---
>             print 'no Python documentation found for
%s' % repr(key)

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

>Comment By: Ka-Ping Yee (ping)
Date: 2002-08-11 05:27

Message:
Logged In: YES 
user_id=45338

I see that your patch changes the functionality of writedoc() so that it 
accepts other objects as well as strings, but you have not explained how 
this fixes a bug, or even what the bug is.

If you feel that the bug is "writedoc() only accepts strings", then i disagree 
that this is a bug.  The designed purpose of writedoc() is to accept a string, 
because then the filename it writes is directly predictable.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-03-18 00:48

Message:
Logged In: YES 
user_id=21627

Can you please provide an example that demonstrates the problem?

Also, can you please regenerate your changes as context (-c)
or unified (-u) diffs, and attach those to this report (do
*not* paste them into the comment field)? In their current,
the patch is pretty useless: SF messed up the indentation,
and it is an old-style patch, and pydoc.py is already at 1.58.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-01 14:45

Message:
Logged In: YES 
user_id=6380

assigned to Tim; this may be Ping's terrain but Ping is
typically not responsive.

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

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