@interruptable
def xwrite(fh, content, encoding=None):
 return fh.write(encode(content, encoding=encoding))

@ interruptable def xwrite ( fh , content , encoding = None ) : return fh . write ( encode ( content , encoding = encoding ) )
write to a filehandle and retry when interrupted .