diff roundup/i18n.py @ 6479:808f7a8ed2b6

Clean leaking file descriptors. Eliminates ResourceWarnings.
author John Rouillard <rouilj@ieee.org>
date Sun, 05 Sep 2021 23:38:10 -0400
parents 289cee42cc19
children f961dbbc3573
line wrap: on
line diff
--- a/roundup/i18n.py	Mon Aug 30 16:17:46 2021 -0400
+++ b/roundup/i18n.py	Sun Sep 05 23:38:10 2021 -0400
@@ -194,6 +194,7 @@
                 # note: current implementation of gettext_module
                 #   always adds fallback to the end of the fallback chain.
                 translator.add_fallback(translation_class(mo))
+            mo.close()
         except IOError:
             # ignore unreadable .mo files
             pass

Roundup Issue Tracker: http://roundup-tracker.org/