diff roundup/mailer.py @ 6491:087cae2fbcea

Handle more ResourceWarning issues. admin.py - remove unneeded close. mailer.py - close debug log file. indexer.py - close read of version file memorydb.py - close python files being compled. Similiar to instance. not sure why it's compoing things and not just letting instance do it. .travis.ymv disable all except 3.9-dev till we get a handle on errors. also increase errors to 50 from 20.
author John Rouillard <rouilj@ieee.org>
date Mon, 06 Sep 2021 16:03:31 -0400
parents aa26a260e81c
children 3cd43c34c095
line wrap: on
line diff
--- a/roundup/mailer.py	Mon Sep 06 15:14:58 2021 -0400
+++ b/roundup/mailer.py	Mon Sep 06 16:03:31 2021 -0400
@@ -278,9 +278,11 @@
             # that resulting file can be openened in a mailer
             fmt = '%a %b %m %H:%M:%S %Y'
             unixfrm = 'From %s %s' % (sender, Date('.').pretty(fmt))
-            open(self.debug, 'a').write('%s\nFROM: %s\nTO: %s\n%s\n\n' %
+            debug_fh = open(self.debug, 'a')
+            debug_fh.write('%s\nFROM: %s\nTO: %s\n%s\n\n' %
                                         (unixfrm, sender,
                                          ', '.join(to), message))
+            debug_fh.close()
         else:
             # now try to send the message
             try:

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