~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2007-04-26 20:52:43 UTC
  • mto: (2488.1.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 2489.
  • Revision ID: v.ladeuil+lp@free.fr-20070426205243-gwo5c2xhd75tezxz
Take jam's remark into account.

* bzrlib/ui/__init__.py:
(CLIUIFactory.get_non_echoed_password): Better to use
osutils.get_terminal_encoding() !

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
import getpass
36
36
 
37
37
from bzrlib import (
 
38
    osutils,
38
39
    progress,
39
40
    trace,
40
41
    )
131
132
                return False
132
133
 
133
134
    def get_non_echoed_password(self, prompt):
134
 
        return getpass.getpass(prompt.encode(sys.stdout.encoding, 'replace'))
 
135
        encoding = osutils.get_terminal_encoding()
 
136
        return getpass.getpass(prompt.encode(encoding, 'replace'))
135
137
 
136
138
    def get_password(self, prompt='', **kwargs):
137
139
        """Prompt the user for a password.