I am adding Git support to an existing application that is written in Python (with PyQt). I decided to interact directly with Git commands through subprocess.Popen and parse the results of the different commands (because it doesn't seem appropriate to import a complete third-party library for the few things we want to implement).
So far I've successfully incorporated git branch and git remote, which more or less worked because I'm still within my local repo.
Now I'm tackling git fetch and run into difficulties.
First I got a "WARNING" from gnome-keyring on stderr. This is due to a problem with my installation, but of course we should not hang up because of such things. So I simply ignore this warning. Probably that's hacky, but for now I think we can live with adding such workarounds if problems should be reported.
But then I have the problem that the shell asks me (on stderr again) to enter my SSH passphrase. This is an issue with my installation on a particular computer too, but we should really accept if users prefer typing their passwords personally. So I have to handle the situation.
So after the lengthy introduction the question is rather concise:
If I run a shell command like git fetch from Python through subprocess.Popen and this shell program asks for user feedback, how can I interact with it from Python?
Basically I would like to display the stderr output to the user and allow him to enter his password. (Then of course implement an option to store this password in the application.)