~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil, Patch Queue Manager, Jelmer Vernooij
  • Date: 2017-01-17 16:20:41 UTC
  • mfrom: (6619.1.2 trunk)
  • Revision ID: tarmac-20170117162041-oo62uk1qsmgc9j31
Merge 2.7 into trunk including fixes for bugs #1622039, #1644003, #1579093 and #1645017. [r=vila]

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):