Projet

Général

Profil

0001-python3-handle-basic-authz-header-encoding-in-tests-.patch

Paul Marillonnet, 01 avril 2019 19:37

Télécharger (916 octets)

Voir les différences:

Subject: [PATCH] python3: handle basic authz header encoding in tests (#31175)

 tests/utils.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tests/utils.py
55 55

  
56 56

  
57 57
def basic_authorization_header(user, password=None):
58
    cred = base64.b64encode('%s:%s' % (user.username, password or user.username))
59
    return {'Authorization': 'Basic %s' % cred}
58
    cred = '%s:%s' % (user.username, password or user.username)
59
    b64cred = base64.b64encode(cred.encode('utf-8')).decode('ascii')
60
    return {'Authorization': 'Basic %s' % b64cred}
60 61

  
61 62

  
62 63
def get_response_form(response, form='form'):
63
-