Mailinglist Archive: opensuse-buildservice (170 mails)

< Previous Next >
Re: [opensuse-buildservice] [PATCH0/0] raw_input checks if stdin is tty
On Wed, Oct 31, 2012 at 11:21:41AM +0100, Michal Vyskocil wrote:
Hi community,


I has been asked by mvancura to not change the behavior, as they handle
the stdin from their scripts.

This has to be revorked somehow ...

Michal Vyskocil

The biggest problem during usage and testing of a remote build feature is the
fact osc asks user several times for the input. In this case, remote process
simply hangs and waits for the response, which is not even displayed, because
of stdout buffering. The samy apply for non-interactive usage - if osc is
called from a script, then it hangs waiting on something on stdin, which will
never come.

Therefor I've added a simple check os.isatty(sys.stdin.fileno()) to the
osc.core.raw_input() - in case it's not terminal, the new RawInputError is
raised. It will show-up the question on stderr and program will be terminated.

I'd say there is some non-interactive osc feature requested by L3 team, which
can be partially solved by this patch
@milan, can you follow up?

BTW: I've added the osc.core.raw_input to and as well, to
enforce the new behavior. The remains untouched, because I was not
sure if this code is even used by osc.

Michal Vyskocil (1):
raw_input checks if stdin is tty

osc/ | 1 +
osc/ | 2 ++
osc/ | 8 ++++++++
osc/ | 2 ++
4 files changed, 13 insertions(+)


< Previous Next >
Follow Ups