Skip to content
Snippets Groups Projects
Commit c3d94398 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

'metadata' entry is expected to be json serializable

so no bytes, and we enforce during the checksum computation function
parent aca1e40f
No related branches found
No related tags found
No related merge requests found
......@@ -266,7 +266,10 @@ def revision_identifier(revision):
metadata = revision.get('metadata', {})
if 'gpgsig' in metadata:
components.extend([b'gpgsig', b' ', metadata['gpgsig'], b'\n'])
gpgsig = metadata['gpgsig']
if isinstance(gpgsig, str):
gpgsig = gpgsig.encode('utf-8')
components.extend([b'gpgsig', b' ', gpgsig, b'\n'])
if 'extra_headers' in metadata:
headers = metadata['extra_headers']
......
......@@ -318,7 +318,7 @@ class RevisionIdentifier(unittest.TestCase):
'offset': 480,
},
'metadata': {
'gpgsig': b'''-----BEGIN PGP SIGNATURE-----
'gpgsig': '''-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Darwin)\n \n iQIcBAABAgAGBQJVJcYsAAoJEBiY3kIkQRNJVAUQAJ8/XQIfMqqC5oYeEFfHOPYZ
L7qy46bXHVBa9Qd8zAJ2Dou3IbI2ZoF6/Et89K/UggOycMlt5FKV/9toWyuZv4Po
L682wonoxX99qvVTHo6+wtnmYO7+G0f82h+qHMErxjP+I6gzRNBvRr+SfY7VlGdK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment