[MERGE] Don't ask a password if there is no real terminal. (#69851)
Alexander Belchenko
bialix at ukr.net
Wed Mar 12 11:51:46 GMT 2008
Jeremy Wilkins пишет:
> Must admit I'm not following this but I've got a different UIFactory
> for the (rather crude) TextMate integration - hence bzr will run
> without a terminal but can still ask for a password (uses
> cocoadialog).
>
> Presumably this shouldn't break that?
I suppose all should be fine. My patch explicitly changed behavior of
method get_non_echoed_password in the class CLIUIFactory. If your
approach simply overloading get_password method you should not be affected
at all by my change.
Here the body of get_non_echoed_password. It's all about interaction with
terminal:
def get_non_echoed_password(self, prompt):
encoding = osutils.get_terminal_encoding()
return getpass.getpass(prompt.encode(encoding, 'replace'))
The problem with redirected stdin in subprocess call is exactly in
getpass.
More information about the bazaar
mailing list