Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more informative error message when opening notebook and disk is full #1444

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nmdanny
Copy link

@nmdanny nmdanny commented Jul 24, 2024

Currently, when trying to load a jupyter notebook when the disk is full, you may see an error as follows:

image

(The reason is, opening a notebook involves SQLite updating the last_seen field in the nbsignatures table, as done by mark_trusted_cells.)

This MR gives a slightly more informative error in this scenario:

image

@@ -11,6 +11,7 @@
import mimetypes
import os
import re
import sqlite3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a guard in case if Python build does no include sqlite3? There is one here:

try:
import sqlite3
except ImportError:
# fallback on pysqlite2 if Python was build without sqlite
from pysqlite2 import dbapi2 as sqlite3 # type:ignore[no-redef]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krassowski

Good catch, I also saw that these attributes were only introduced in python 3.11, so I've made this check a bit more robust, with a string based comparison as fallback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants