[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

nestor report at bugs.python.org
Mon Jun 8 22:09:34 CEST 2009


nestor <nestornissen at gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6236>
_______________________________________


More information about the Python-bugs-list mailing list