def _open(self, path, mode="r"):
if mode == "w":
self.add_file(path, "")
with io.StringIO(self.files[path]) as f:
yield f
self.files[path] = f.getvalue() // Update the content
After Change
with fobj as f:
yield f
new_content = f.getvalue() // Update the content
self.files[path] = new_content.decode("utf-8") if is_binary else new_content // pytype: disable=attribute-error
def _rename(self, from_, to, overwrite=False):
if not overwrite and to in self.files: