[MERGE] Don't ask a password if there is no real terminal. (#69851)
Jeremy Wilkins
jeb at jdwilkins.co.uk
Wed Mar 12 17:40:09 GMT 2008
Cool, I don't use CLIUIFactory, I use CocoaUIFactory instead. So that
should be fine.
jeb
On Wed, Mar 12, 2008 at 11:51 AM, Alexander Belchenko <bialix at ukr.net> wrote:
> 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