def writefile(self, filename):
        self.fixlastline()
        chars = self.encode(self.text.get("1.0", "end-1c"))
        if self.eol_convention != "\n":
            chars = chars.replace("\n", self.eol_convention)
        try:
            with open(filename, "wb") as f:
                f.write(chars)
            return True
        except __HOLE__ as msg:
            tkMessageBox.showerror("I/O Error", str(msg),
                                   master=self.text)
            return False
dataset/ETHPy150Open francelabs/datafari/windows/python/Lib/idlelib/IOBinding.py/IOBinding.writefile