osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subprocess svn checkout password issue


On 03/16/2019 10:08 AM, Grant Edwards wrote:
> I don't know about svn specifically, but in the past it was typical
> for programs requiring passwords and assuming interactive usage to
> issue the password prompt to and read the password from /dev/tty,
> rather than stdin/stdout.  That allowed their use in a pipeline
> without contaminating the pipe's data with the password prompt and
> password.  In "normal" usage /dev/tty and stdin/stdout/stderr are all
> the same device, but when used via a library like subprocess, you
> couldn't provide the password via stdin.

There's a python library (Linux and Unix only I think) called pexpect[1]
that can drive programs that expect a pty for taking password input.

[1] https://pypi.org/project/pexpect/