~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2007-03-05 20:51:42 UTC
  • mfrom: (2298.7.1 87765)
  • mto: This revision was merged to the branch mainline in revision 2315.
  • Revision ID: john@arbash-meinel.com-20070305205142-3xhccyveuakkrj87
(Vincent Ladeuil) invalid proxy vars should not cause a traceback (bug #87765)

Show diffs side-by-side

added added

removed removed

Lines of Context:
702
702
        if self._debuglevel > 0:
703
703
            print 'set_proxy %s_request for %r' % (type, proxy)
704
704
        orig_type = request.get_type()
705
 
        type, r_type = urllib.splittype(proxy)
706
 
        host, XXX = urllib.splithost(r_type)
707
 
        if '@' in host:
 
705
        scheme, r_scheme = urllib.splittype(proxy)
 
706
        if self._debuglevel > 0:
 
707
            print 'scheme: %s, r_scheme: %s' % (scheme, r_scheme)
 
708
        host, XXX = urllib.splithost(r_scheme)
 
709
        if host is None:
 
710
            raise errors.InvalidURL(proxy,
 
711
                                    'Invalid syntax in proxy env variable')
 
712
        elif '@' in host:
708
713
            user_pass, host = host.split('@', 1)
709
714
            if ':' in user_pass:
710
715
                user, password = user_pass.split(':', 1)