~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_urllib2_wrappers.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-27 10:48:00 UTC
  • mfrom: (5923.1.3 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20110527104800-fvcjlygvqloos6kl
(vila) Require prompts to always be unicode (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1260
1260
        user. The daughter classes should implements a public
1261
1261
        build_password_prompt using this method.
1262
1262
        """
1263
 
        prompt = '%s' % auth['protocol'].upper() + ' %(user)s@%(host)s'
 
1263
        prompt = u'%s' % auth['protocol'].upper() + u' %(user)s@%(host)s'
1264
1264
        realm = auth['realm']
1265
1265
        if realm is not None:
1266
 
            prompt += ", Realm: '%s'" % realm
1267
 
        prompt += ' password'
 
1266
            prompt += u", Realm: '%s'" % realm.decode('utf8')
 
1267
        prompt += u' password'
1268
1268
        return prompt
1269
1269
 
1270
1270
    def _build_username_prompt(self, auth):
1278
1278
        user. The daughter classes should implements a public
1279
1279
        build_username_prompt using this method.
1280
1280
        """
1281
 
        prompt = '%s' % auth['protocol'].upper() + ' %(host)s'
 
1281
        prompt = u'%s' % auth['protocol'].upper() + u' %(host)s'
1282
1282
        realm = auth['realm']
1283
1283
        if realm is not None:
1284
 
            prompt += ", Realm: '%s'" % realm
1285
 
        prompt += ' username'
 
1284
            prompt += u", Realm: '%s'" % realm.decode('utf8')
 
1285
        prompt += u' username'
1286
1286
        return prompt
1287
1287
 
1288
1288
    def http_request(self, request):
1552
1552
 
1553
1553
    def build_password_prompt(self, auth):
1554
1554
        prompt = self._build_password_prompt(auth)
1555
 
        prompt = 'Proxy ' + prompt
 
1555
        prompt = u'Proxy ' + prompt
1556
1556
        return prompt
1557
1557
 
1558
1558
    def build_username_prompt(self, auth):
1559
1559
        prompt = self._build_username_prompt(auth)
1560
 
        prompt = 'Proxy ' + prompt
 
1560
        prompt = u'Proxy ' + prompt
1561
1561
        return prompt
1562
1562
 
1563
1563
    def http_error_407(self, req, fp, code, msg, headers):