Skip to content

Commit 9e1eeb4

Browse files
committed
Fix encoding errors when using prepend strategy during migration (fixes #171)
1 parent f3232cf commit 9e1eeb4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core/importer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def strat_text_prepend(src, dest):
9393
log.i('importing {} to {} by copying'.format(src, dest))
9494
shutil.copy2(src, dest)
9595
return True
96-
with open(src) as f:
96+
with open(src, encoding='latin1') as f:
9797
srctext = f.read()
98-
with open(dest) as f:
98+
with open(dest, encoding='latin1') as f:
9999
desttext = f.read()
100-
with open(src, 'w') as f:
100+
with open(src, 'w', encoding='latin1') as f:
101101
log.i('importing {} to {} by prepending'.format(src, dest))
102102
f.writelines([srctext, '\n', desttext])
103103
return True

0 commit comments

Comments
 (0)