@@ -186,7 +186,8 @@ def default_config():
186186
187187class Grab (DeprecatedThings ):
188188
189- __slots__ = ('request_head' , 'request_log' , 'request_body' ,
189+ __slots__ = ('request_head' , 'request_body' ,
190+ #'request_log',
190191 'proxylist' , 'config' ,
191192 'transport' ,
192193 'transport_param' , 'request_method' , 'request_counter' ,
@@ -200,7 +201,8 @@ class Grab(DeprecatedThings):
200201
201202 # Attributes which should be processed when clone
202203 # of Grab instance is creating
203- clonable_attributes = ('request_head' , 'request_log' , 'request_body' ,
204+ clonable_attributes = ('request_head' , 'request_body' ,
205+ #'request_log',
204206 'proxylist' )
205207
206208 # Complex config items which points to mutable objects
@@ -272,7 +274,7 @@ def reset(self):
272274 """
273275
274276 self .request_head = None
275- self .request_log = None
277+ # self.request_log = None
276278 self .request_body = None
277279 self .request_method = None
278280 self .transport .reset ()
@@ -580,7 +582,7 @@ def copy_request_data(self):
580582 # TODO: Maybe request object?
581583 self .request_head = self .transport .request_head
582584 self .request_body = self .transport .request_body
583- self .request_log = self .transport .request_log
585+ # self.request_log = self.transport.request_log
584586
585587 def setup_document (self , content , ** kwargs ):
586588 """
@@ -666,15 +668,15 @@ def save_dumps(self):
666668 thread_name = '-%s' % thread_name
667669 file_name = os .path .join (self .config ['log_dir' ], '%02d%s.log' % (
668670 self .request_counter , thread_name ))
669- with open (file_name , 'w ' ) as out :
670- out .write ('Request headers:\n ' )
671+ with open (file_name , 'wb ' ) as out :
672+ out .write (b 'Request headers:\n ' )
671673 out .write (self .request_head )
672- out .write ('\n ' )
673- out .write ('Request body:\n ' )
674+ out .write (b '\n ' )
675+ out .write (b 'Request body:\n ' )
674676 out .write (self .request_body )
675- out .write ('\n \n ' )
676- out .write ('Response headers:\n ' )
677- out .write (self .doc .head . decode ( 'ascii' ) )
677+ out .write (b '\n \n ' )
678+ out .write (b 'Response headers:\n ' )
679+ out .write (self .doc .head )
678680
679681 file_extension = 'html'
680682 file_name = os .path .join (self .config ['log_dir' ], '%02d%s.%s' % (
0 commit comments