Browse Source

write utf-8

master
j 1 year ago
parent
commit
349383ff39
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      oml/update.py

+ 3
- 3
oml/update.py View File

@@ -621,10 +621,10 @@ def migrate_13():
with db.session() as session:
revision = -1
qs = changelog.Changelog.query.filter_by(user_id=settings.USER_ID)
with open(path, 'w') as fd:
with open(path, 'wb') as fd:
for c in qs.order_by('timestamp'):
data = json.dumps([c.revision, c.timestamp, json.loads(c.data)], ensure_ascii=False)
fd.write(data + '\n')
data = json.dumps([c.revision, c.timestamp, json.loads(c.data)], ensure_ascii=False).encode('utf-8')
fd.write(data + b'\n')
revision = c.revision
if revision > -1:
settings.server['revision'] = revision

Loading…
Cancel
Save