mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 23:21:32 +00:00
Fix non-unicode files kill whole webide backend
This commit is contained in:
parent
fc168f47ef
commit
d0a04240b6
@ -30,12 +30,12 @@ class FileManager:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def file_contents(self):
|
def file_contents(self):
|
||||||
with open(self._filepath(self.filename), 'r') as ifile:
|
with open(self._filepath(self.filename), 'r', errors='surrogateescape') as ifile:
|
||||||
return ifile.read()
|
return ifile.read()
|
||||||
|
|
||||||
@file_contents.setter
|
@file_contents.setter
|
||||||
def file_contents(self, value):
|
def file_contents(self, value):
|
||||||
with open(self._filepath(self.filename), 'w') as ofile:
|
with open(self._filepath(self.filename), 'w', errors='surrogateescape') as ofile:
|
||||||
ofile.write(value)
|
ofile.write(value)
|
||||||
|
|
||||||
def _filepath(self, filename):
|
def _filepath(self, filename):
|
||||||
|
Loading…
Reference in New Issue
Block a user