~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2007-04-26 08:16:29 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-20070426081629-g0rsiqfszpxz2tto
Fix 110204 by letting TestUIFactory encode password prompt.

* bzrlib/ui/__init__.py:
(CLIUIFactory.get_non_echoed_password): Encode prompt with
sys.stdout.
(CLIUIFactory.get_password): Delegate prompt encoding to
get_non_echoed_password.

* bzrlib/tests/__init__.py:
(TestUIFactory.get_non_echoed_password): Encode prompt with
self.stdout.

Show diffs side-by-side

added added

removed removed

Lines of Context:
721
721
    def get_non_echoed_password(self, prompt):
722
722
        """Get password from stdin without trying to handle the echo mode"""
723
723
        if prompt:
724
 
            self.stdout.write(prompt)
 
724
            self.stdout.write(prompt.encode(self.stdout.encoding, 'replace'))
725
725
        password = self.stdin.readline()
726
726
        if not password:
727
727
            raise EOFError