Skip to content

Commit 084d21e

Browse files
committed
Fix nbconvert handler run_sync()
1 parent 923a828 commit 084d21e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

jupyter_server/nbconvert/handlers.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async def get(self, format, path):
119119
# Exporting can take a while, delegate to a thread so we don't block the event loop
120120
try:
121121
output, resources = await run_sync(
122-
exporter.from_notebook_node(nb, resources=resource_dict)
122+
exporter.from_notebook_node, nb, resource_dict
123123
)
124124
except Exception as e:
125125
self.log.exception("nbconvert failed: %s", e)
@@ -146,20 +146,19 @@ class NbconvertPostHandler(JupyterHandler):
146146
SUPPORTED_METHODS = ("POST",)
147147

148148
@web.authenticated
149-
def post(self, format):
149+
async def post(self, format):
150150
exporter = get_exporter(format, config=self.config)
151151

152152
model = self.get_json_body()
153153
name = model.get("name", "notebook.ipynb")
154154
nbnode = from_dict(model["content"])
155155

156156
try:
157-
output, resources = exporter.from_notebook_node(
157+
output, resources = await run_sync(
158+
exporter.from_notebook_node,
158159
nbnode,
159-
resources={
160-
"metadata": {
161-
"name": name[: name.rfind(".")],
162-
},
160+
{
161+
"metadata": {"name": name[: name.rfind(".")]},
163162
"config_dir": self.application.settings["config_dir"],
164163
},
165164
)

0 commit comments

Comments
 (0)