#NEWLINE# def _convert( self , b ) : #NEWLINE# #INDENT# if isinstance ( b , six . text_type ) : #NEWLINE# #INDENT# b = b . encode ( self . encoding ) #NEWLINE# warnings . warn ( 'Writing unicode to byte stream' , stacklevel = 2 ) #NEWLINE# #UNINDENT# return self