mirror of
				https://github.com/avatao-content/baseimage-tutorial-framework
				synced 2025-11-04 15:22:54 +00:00 
			
		
		
		
	Fix non-unicode files kill whole webide backend
This commit is contained in:
		@@ -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):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user