#NEWLINE# def _debug_set_cookie( self , response , spider ) : #NEWLINE# #INDENT# if self . debug : #NEWLINE# #INDENT# cl = [ to_native_str ( c , errors = 'replace' ) for c in response . headers . getlist ( 'Set-Cookie' ) ] #NEWLINE# if cookies : #NEWLINE# #INDENT# cookies = '\n' . join ( ( 'Set-Cookie: {}\n' . format ( c ) for c in cl ) ) #NEWLINE# msg = 'Received cookies from: {}\n{}' . format ( response , cookies ) #NEWLINE# logger . debug ( msg , extra = { #NEWLINE# #INDENT# 'spider' : spider , #NEWLINE# #UNINDENT# } )