timkpaine / jupyterlab_autoversion

Automatically version jupyter notebooks in JupyterLab
https://jupyterlab-autoversion.readthedocs.io
Apache License 2.0
80 stars 10 forks source link

Add __name__ attr to post save hook partial for SingleUserNotebookApp #87

Closed capdevc closed 2 years ago

capdevc commented 2 years ago

Fixes this error that causes the extension not to load:

[W 2022-04-09 01:28:04.201 SingleUserNotebookApp manager:356] jupyterlab_autoversion.extension | extension failed loading with message: 'functools.partial' object has no attribute '__name__'

functools.partials are "name"-less which breaks initialization in SingleUserNotebookApp, which is used by Jupyterlab instances started under JupyterHub.

There are a couple of options for fixes (like using a closure instead of partial), but patching in a name attribute seems like the smallest change.

capdevc commented 2 years ago

After some further testing, this gets the extension loaded, but the save hook still doesn't work in my case. Will reopen if I can fix it