Message9402

Author zyasoft
Recipients girish946, kanglecjr, zyasoft
Date 2015-01-15.20:59:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421355549.17.0.485816090087.issue2209@psf.upfronthosting.co.za>
In-reply-to
Content
Unfortunately, this problem is not so easy to fix: it's not just a matter of dispatching on Windows. I also tried creating a minimal program to see if it would help:

import os
from subprocess import _cmdline2listimpl, _escape_args, _shell_command
from java.lang import IllegalArgumentException, ProcessBuilder
from java.io import File, IOException

def page(command):
    args = _cmdline2listimpl(command)
    args = _escape_args(args)
    args = _shell_command + args
    print repr(args)
    cwd = os.getcwd()
    builder = ProcessBuilder(args)
    builder.directory(File(cwd))
    builder.redirectOutput(ProcessBuilder.Redirect.INHERIT)
    try:
        proc = builder.start()
        return proc.waitFor()
    except (IOException,
            IllegalArgumentException), e:
        raise OSError(e.getMessage() or e)

page("more NEWS")

Works on posix systems, but not on Windows.

Most likely this is some bad interaction between JLine and the subprocess. I believe the way to fix this is to use JLine, by writing a pager directly against it. Should be reasonably straightforward.
History
Date User Action Args
2015-01-15 20:59:09zyasoftsetmessageid: <1421355549.17.0.485816090087.issue2209@psf.upfronthosting.co.za>
2015-01-15 20:59:09zyasoftsetrecipients: + zyasoft, kanglecjr, girish946
2015-01-15 20:59:09zyasoftlinkissue2209 messages
2015-01-15 20:59:08zyasoftcreate