Skip to content

Commit

Permalink
Fixed a read file error. #428
Browse files Browse the repository at this point in the history
  • Loading branch information
Robot-Will committed Apr 12, 2017
1 parent 1228055 commit 91fcdef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/base_utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def read(self):
"""Method Docs."""
text = ''
try:
with codecs.open(self._path, 'r', self._encoding) as f:
with codecs.open(self._path, 'r', self._encoding, 'ignore') as f:
text = f.read()
except (IOError, UnicodeError):
pass
Expand All @@ -148,7 +148,7 @@ def write(self, text, append=False):
if not os.path.isdir(self._dir):
os.makedirs(self._dir)
try:
with codecs.open(self._path, mode, self._encoding) as f:
with codecs.open(self._path, mode, self._encoding, 'ignore') as f:
f.write(text)
except (IOError, UnicodeError):
pass
Expand Down

0 comments on commit 91fcdef

Please sign in to comment.