Skip to content

Commit

Permalink
bugfix: convert nb dict to nb Node before calling jupytext.writes
Browse files Browse the repository at this point in the history
  • Loading branch information
telamonian committed Sep 29, 2020
1 parent a609a0e commit a007c67
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions jupytext/contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,22 @@ def save_one_file(path, fmt):
text_model = dict(
type="file",
format="text",
content=jupytext.writes(model["content"], fmt=fmt),
content=jupytext.writes(
nbformat.from_dict(model["content"]), fmt=fmt
),
)

return self.super.save(text_model, path)

return write_pair(path, jupytext_formats, save_one_file)

except Exception as e:
self.log.error(u'Error while saving file: %s %s', path, e, exc_info=True)
raise HTTPError(500, u'Unexpected error while saving file: %s %s' % (path, e))
self.log.error(
u"Error while saving file: %s %s", path, e, exc_info=True
)
raise HTTPError(
500, u"Unexpected error while saving file: %s %s" % (path, e)
)

def get(
self,
Expand Down

0 comments on commit a007c67

Please sign in to comment.