def writeln(self, arg=None): if arg: self.write(arg) self.write(u('\n')) # text-mode streams translate to \r\n if needed