diff --git a/datacite.py b/datacite.py index 4dd2f47c4..3f5146f56 100644 --- a/datacite.py +++ b/datacite.py @@ -19,7 +19,7 @@ def metadata_post(ctx, payload): response = requests.post(url, auth=auth, - data=payload, + data=payload.encode(), headers=headers, timeout=30, verify=config.datacite_tls_verify) @@ -35,7 +35,7 @@ def metadata_put(ctx, doi, payload): response = requests.put(url, auth=auth, - data=payload, + data=payload.encode(), headers=headers, timeout=30, verify=config.datacite_tls_verify) diff --git a/publication.py b/publication.py index 522605497..c30aca478 100644 --- a/publication.py +++ b/publication.py @@ -605,7 +605,7 @@ def set_access_restrictions(ctx, vault_package, publication_state): """ # Embargo handling combiJsonPath = publication_state["combiJsonPath"] - dictJsonData = jsonutil.read(ctx, combiJsonPath, want_bytes=False) + dictJsonData = jsonutil.read(ctx, combiJsonPath) # Remove empty objects to prevent empty fields on landingpage. dictJsonData = misc.remove_empty_objects(dictJsonData)