[Python-bugs-list] [ python-Bugs-405553 ] pydoc.help broken in IDLE

noreply@sourceforge.net noreply@sourceforge.net
Tue, 20 Mar 2001 10:30:07 -0800


Bugs item #405553, was updated on 2001-03-02 15:06
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=405553&group_id=5470

Category: Python Library
Group: None
Status: Open
Priority: 7
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Ka-Ping Yee (ping)
Summary: pydoc.help broken in IDLE

Initial Comment:
pydoc has an (undocumented?) feature that after "from
pydoc import help" in an interactive interpreter,
help(object) or help("modulename") gives help.

This doesn't work right in IDLE:

On Unix, it brings up a pager in the terminal window
where IDLE was started.  That's not what you want!!!

On Windows, where IDLE is normally started from the
Start menu, it gives an error, complaining about an
invalid file descriptor.

Perhaps it should invoke a stupid internal pager, like
the one used by the license() built-in command?  That
"just works" in IDLE!


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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-03-20 10:30

Message:
Logged In: YES 
user_id=6380

Hi Ping, the attached files never showed up on SF.

I think the SF problems have been fixed now, but I recommend
that you just check the patch in.  pydoc is your code -- you
can make it and break it!

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

Comment By: Ka-Ping Yee (ping)
Date: 2001-03-03 18:35

Message:
Logged In: YES 
user_id=45338

Here's a little patch.  It just looks for __file__.

I tried help('sys') and all was well.

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

Comment By: Ka-Ping Yee (ping)
Date: 2001-03-03 18:32

Message:
Logged In: YES 
user_id=45338

The pydoc.getpager() routine was written to try to take
care of this case by making sure that sys.stdout is a real
file and sys.stdin is a tty before launching an interactive
pager.  I just tried it now in IDLE with

Python 2.1a2 (#1, Mar  1 2001, 00:10:25) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on
linux2
Type "copyright", "credits" or "license" for more
information.
IDLE 0.6 -- press F1 for help
>>> from pydoc import help
>>> help('atexit')
Help on module atexit:

NAME
    atexit

...

and it worked fine.

I bet you tried "help('sys')", didn't you?  That clobbers
sys.stdin and sys.stdout by reloading 'sys'.  Not sure what
to do about that.  I suppose i could just add a special case
to never reload built-in modules.


-- ?!ng

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

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