From 1f5dd216bf25cc4ff6c82540ed7177ff83e93b99 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 12 Jul 2023 21:40:53 +0100 Subject: [PATCH] Close standard streams on exit Prevents the warning: "ResourceWarning: unclosed file" --- gramps/grampsapp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gramps/grampsapp.py b/gramps/grampsapp.py index 4551bf13e..e67c95fd4 100644 --- a/gramps/grampsapp.py +++ b/gramps/grampsapp.py @@ -619,5 +619,8 @@ def main(): for error in errors: logging.warning(error[0] + error[1]) + sys.stdout.close() + sys.stderr.close() + if __name__ == '__main__': main()