Changed some remaining cases of open() to io.open().

- Legacy-Id: 17319
This commit is contained in:
Henrik Levkowetz 2020-02-20 22:35:49 +00:00
parent 0c343b9bbd
commit 2aa948a17b
4 changed files with 6 additions and 6 deletions

View file

@ -84,7 +84,7 @@ for log in logfiles:
import gzip
logfile = gzip.open(log)
else:
logfile = open(log)
logfile = io.open(log)
queue_ids = []
for line in logfile:
if from_email in line and "Confirmation for Auto-Post of I-D "+draft in line:

View file

@ -123,8 +123,8 @@ if __name__ == '__main__':
date = time.strftime("%Y-%m-%d_%H:%M:%S")
signature = '# Generated by %s at %s\n' % (filename, date)
afile = open(settings.DRAFT_ALIASES_PATH, "w")
vfile = open(settings.DRAFT_VIRTUAL_PATH, "w")
afile = io.open(settings.DRAFT_ALIASES_PATH, "w")
vfile = io.open(settings.DRAFT_VIRTUAL_PATH, "w")
afile.write(signature)
vfile.write(signature)

View file

@ -58,8 +58,8 @@ if __name__ == '__main__':
date = time.strftime("%Y-%m-%d_%H:%M:%S")
signature = '# Generated by %s at %s\n' % (filename, date)
afile = open(settings.GROUP_ALIASES_PATH, "w")
vfile = open(settings.GROUP_VIRTUAL_PATH, "w")
afile = io.open(settings.GROUP_ALIASES_PATH, "w")
vfile = io.open(settings.GROUP_VIRTUAL_PATH, "w")
afile.write(signature)
vfile.write(signature)

View file

@ -2530,7 +2530,7 @@ class MaterialsTests(TestCase):
path = os.path.join(submission.session.meeting.get_materials_path(),'slides')
filename = os.path.join(path,session.sessionpresentation_set.first().document.name+'-01.txt')
self.assertTrue(os.path.exists(filename))
contents = open(filename,'r').read()
contents = io.open(filename,'r').read()
self.assertIn('third version', contents)