#NEWLINE# def write_outstream( stream , * text ) : #NEWLINE# #INDENT# encoding = ( getattr ( stream , 'encoding' , 'ascii' ) or 'ascii' ) #NEWLINE# for t in text : #NEWLINE# #INDENT# if ( not isinstance ( t , binary_type ) ) : #NEWLINE# #INDENT# t = t . encode ( encoding , 'replace' ) #NEWLINE# #UNINDENT# t = t . decode ( encoding ) #NEWLINE# try : #NEWLINE# #INDENT# stream . write ( t ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# break