Changed agenda file reading to read files as binary when looking for draft names listed in the agenda.

- Legacy-Id: 16505
This commit is contained in:
Henrik Levkowetz 2019-07-17 13:38:46 +00:00
parent 8d2d732210
commit 6ef24e9c4e
2 changed files with 2 additions and 2 deletions

View file

@ -216,7 +216,7 @@ def read_session_file(type, num, doc):
# FIXME: uploaded_filename should be replaced with a function call that computes names that are fixed
path = os.path.join(settings.AGENDA_PATH, "%s/%s/%s" % (num, type, doc.uploaded_filename))
if os.path.exists(path):
with io.open(path) as f:
with io.open(path, 'rb') as f:
return f.read(), path
else:
return None, path

View file

@ -656,7 +656,7 @@ def session_draft_list(num, acronym):
for agenda in agendas:
content, _ = read_agenda_file(num, agenda)
if content:
drafts.update(re.findall('(draft-[-a-z0-9]*)', content))
drafts.update(re.findall(b'(draft-[-a-z0-9]*)', content))
result = []
for draft in drafts: