From 8ed039107bf4767a1fd8f88352ada756cf79431e Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 3 May 2018 14:16:27 -0700 Subject: [PATCH] The git blob needs to be bytes In py3 str is unicode so it needs to be encoded as UTF-8 when writing to the blob. --- src/pylorax/api/recipes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pylorax/api/recipes.py b/src/pylorax/api/recipes.py index dd47c514..6889e9dc 100644 --- a/src/pylorax/api/recipes.py +++ b/src/pylorax/api/recipes.py @@ -83,7 +83,7 @@ class Recipe(dict): def toml(self): """Return the Recipe in TOML format""" - return toml.dumps(self).encode("UTF-8") + return toml.dumps(self) def bump_version(self, old_version=None): """semver recipe version number bump @@ -298,7 +298,7 @@ def write_commit(repo, branch, filename, message, content): parent_commit = head_commit(repo, branch) parent_commit = head_commit(repo, branch) - blob_id = repo.create_blob_from_buffer(content) + blob_id = repo.create_blob_from_buffer(content.encode("UTF-8")) # Use treebuilder to make a new entry for this filename and blob parent_tree = parent_commit.get_tree()