~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2017-01-17 13:48:10 UTC
  • mfrom: (6615.3.6 merges)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20170117134810-j9p3lidfy6pfyfsc
Merge 2.7, resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2013, 2016 Canonical Ltd
 
1
# Copyright (C) 2006-2013, 2016, 2017 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
48
48
# actual code more or less do that, tests should be written to
49
49
# ensure that.
50
50
 
 
51
import base64
51
52
import errno
52
53
import httplib
53
54
import os
1491
1492
 
1492
1493
    def build_auth_header(self, auth, request):
1493
1494
        raw = '%s:%s' % (auth['user'], auth['password'])
1494
 
        auth_header = 'Basic ' + raw.encode('base64').strip()
 
1495
        auth_header = 'Basic ' + base64.b64encode(raw)
1495
1496
        return auth_header
1496
1497
 
1497
1498
    def extract_realm(self, header_value):