Skip to content

Commit

Permalink
Fix encoding errors when using prepend strategy during migration (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pidgeot committed Jun 18, 2020
1 parent f3232cf commit 9e1eeb4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ def strat_text_prepend(src, dest):
log.i('importing {} to {} by copying'.format(src, dest))
shutil.copy2(src, dest)
return True
with open(src) as f:
with open(src, encoding='latin1') as f:
srctext = f.read()
with open(dest) as f:
with open(dest, encoding='latin1') as f:
desttext = f.read()
with open(src, 'w') as f:
with open(src, 'w', encoding='latin1') as f:
log.i('importing {} to {} by prepending'.format(src, dest))
f.writelines([srctext, '\n', desttext])
return True
Expand Down

0 comments on commit 9e1eeb4

Please sign in to comment.