Hotfix
This commit is contained in:
parent
d679006b34
commit
c87333411a
@ -87,7 +87,9 @@ class SlowRequests(Session):
|
|||||||
|
|
||||||
body = "[{dt}]\tURL: '{url}'\tMETHOD: {met}\tARGS: {args}\n".format(dt=utils.now().strftime("%F %T"),
|
body = "[{dt}]\tURL: '{url}'\tMETHOD: {met}\tARGS: {args}\n".format(dt=utils.now().strftime("%F %T"),
|
||||||
url=url, met=method, args=args)
|
url=url, met=method, args=args)
|
||||||
utils.write_file(self.request_log_name, body)
|
with open(self.request_log_name, 'ab') as file:
|
||||||
|
file.write(body.encode("UTF-8"))
|
||||||
|
pass
|
||||||
|
|
||||||
def _log_response(self, url, resp, redirect: bool = False):
|
def _log_response(self, url, resp, redirect: bool = False):
|
||||||
from erepublik import Citizen
|
from erepublik import Citizen
|
||||||
@ -111,8 +113,7 @@ class SlowRequests(Session):
|
|||||||
file_data.update({"ext": "html"})
|
file_data.update({"ext": "html"})
|
||||||
|
|
||||||
filename = 'debug/requests/{time}_{name}{extra}.{ext}'.format(**file_data)
|
filename = 'debug/requests/{time}_{name}{extra}.{ext}'.format(**file_data)
|
||||||
with open(utils.get_file(filename), 'wb') as f:
|
utils.write_file(filename, resp.text)
|
||||||
f.write(resp.text.encode('utf-8'))
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user