~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

(vila) AuthConfig alwaus return user/password as unicode. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
            password = self.stdin.readline()
239
239
            if not password:
240
240
                password = None
241
 
            elif password[-1] == '\n':
242
 
                password = password[:-1]
 
241
            else:
 
242
                password = password.decode(self.stdin.encoding)
 
243
 
 
244
                if password[-1] == '\n':
 
245
                    password = password[:-1]
243
246
        return password
244
247
 
245
248
    def get_password(self, prompt=u'', **kwargs):
273
276
        username = self.stdin.readline()
274
277
        if not username:
275
278
            username = None
276
 
        elif username[-1] == '\n':
277
 
            username = username[:-1]
 
279
        else:
 
280
            username = username.decode(self.stdin.encoding)
 
281
            if username[-1] == '\n':
 
282
                username = username[:-1]
278
283
        return username
279
284
 
280
285
    def make_progress_view(self):