windows fails to open utf-8 files as utf-8
This commit is contained in:
parent
b4b66f9bd5
commit
41d90e1736
2 changed files with 5 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import codecs
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
|
|
@ -52,7 +53,7 @@ class Peer(object):
|
|||
def apply_log(self):
|
||||
changes = []
|
||||
if os.path.exists(self._logpath):
|
||||
with open(self._logpath) as fd:
|
||||
with codecs.open(self._logpath, 'r', encoding='utf-8') as fd:
|
||||
for line in fd:
|
||||
if line:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue