Author nestor
Recipients nestor
Date 2009-06-08.20:09:32
SpamBayes Score 2.39987e-11
Marked as misclassified No
Message-id <1244491774.67.0.30778987442.issue6236@psf.upfronthosting.co.za>
In-reply-to
Content
This quick and dirty fix in pydoc.py makes so it no longer aborts help.

(less behaves somewhat strange for some commands but that is better than
no help at all)

def pipepager(text, cmd):
    """Page through text by feeding it to another program."""
    import subprocess
    pipe=subprocess.Popen(cmd,stdin=subprocess.PIPE).stdin
    #pipe = os.popen(cmd, 'w')
    try:
        pipe.write(bytes(text,sys.getdefaultencoding()))
        #pipe.write(text)
        pipe.close()
    except IOError:
        pass # Ignore broken pipes caused by quitting the pager program.
History
Date User Action Args
2009-06-08 20:09:34nestorsetrecipients: + nestor
2009-06-08 20:09:34nestorsetmessageid: <1244491774.67.0.30778987442.issue6236@psf.upfronthosting.co.za>
2009-06-08 20:09:32nestorlinkissue6236 messages
2009-06-08 20:09:32nestorcreate