~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: 2010-10-12 09:02:58 UTC
  • mfrom: (5484.2.2 654684-password)
  • Revision ID: pqm@pqm.ubuntu.com-20101012090258-dxr8yxh0wnpv8jh2
(mbp) avoid "KeyError: port" in urllib authentication callback (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1202
1202
        user = auth.get('user', None)
1203
1203
        password = auth.get('password', None)
1204
1204
        realm = auth['realm']
 
1205
        port = auth.get('port', None)
1205
1206
 
1206
1207
        if user is None:
1207
1208
            user = auth_conf.get_user(auth['protocol'], auth['host'],
1208
 
                                      port=auth['port'], path=auth['path'],
 
1209
                                      port=port, path=auth['path'],
1209
1210
                                      realm=realm, ask=True,
1210
1211
                                      prompt=self.build_username_prompt(auth))
1211
1212
        if user is not None and password is None:
1212
1213
            password = auth_conf.get_password(
1213
 
                auth['protocol'], auth['host'], user, port=auth['port'],
 
1214
                auth['protocol'], auth['host'], user,
 
1215
                port=port,
1214
1216
                path=auth['path'], realm=realm,
1215
1217
                prompt=self.build_password_prompt(auth))
1216
1218