-
Notifications
You must be signed in to change notification settings - Fork 430
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
sqlite3.OperationalError: database or disk is full #2 #1218
base: master
Are you sure you want to change the base?
Conversation
For https://gramps-project.org/bugs/view.php?id=12306 1. Add check disk space before close db, save config file, autobackup and XML backup. 2. Add new function get_avail_disk_size(). I have problem: I can't restore connection to window in quit() if user abort to quit.
Codecov Report
@@ Coverage Diff @@
## master #1218 +/- ##
==========================================
- Coverage 41.16% 41.14% -0.02%
==========================================
Files 1062 1062
Lines 144703 144771 +68
==========================================
+ Hits 59564 59565 +1
- Misses 85139 85206 +67
Continue to review full report at Codecov.
|
# import psutil | ||
# DISK = get disk from 'dbfolder' | ||
# freedisk = psutil.disk_usage(DISK).free/(1024*1024) | ||
# print(f"{freedisk:.4} Mb free on disk {DISK}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.python.org/3/library/shutil.html should be used here to get the disk space free "shutil.disk_usage(path)" as it is supposed to work across platforms as of Python 3.3 (which we are now requiring). And we already use the shutil library, so no new dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I didn't know about this function.
I had problems with PR. All my commit join to last PR, @1212 created without .py file... |
I have converted this PR to draft because it is not ready for merging. It doesn't work for Mac or Windows yet. |
For https://gramps-project.org/bugs/view.php?id=12306
backup.
I have problem: I can't restore connection to window in quit() if user abort to
quit.