comparison 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
comparison
equal deleted inserted replaced
6490:47a7fc39eaf0 6491:087cae2fbcea
276 if self.debug: 276 if self.debug:
277 # don't send - just write to a file, use unix from line so 277 # don't send - just write to a file, use unix from line so
278 # that resulting file can be openened in a mailer 278 # that resulting file can be openened in a mailer
279 fmt = '%a %b %m %H:%M:%S %Y' 279 fmt = '%a %b %m %H:%M:%S %Y'
280 unixfrm = 'From %s %s' % (sender, Date('.').pretty(fmt)) 280 unixfrm = 'From %s %s' % (sender, Date('.').pretty(fmt))
281 open(self.debug, 'a').write('%s\nFROM: %s\nTO: %s\n%s\n\n' % 281 debug_fh = open(self.debug, 'a')
282 debug_fh.write('%s\nFROM: %s\nTO: %s\n%s\n\n' %
282 (unixfrm, sender, 283 (unixfrm, sender,
283 ', '.join(to), message)) 284 ', '.join(to), message))
285 debug_fh.close()
284 else: 286 else:
285 # now try to send the message 287 # now try to send the message
286 try: 288 try:
287 # send the message as admin so bounces are sent there 289 # send the message as admin so bounces are sent there
288 # instead of to roundup 290 # instead of to roundup

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