lister_base: when storing responses for debugging, use a timestamp as filename
This commit is contained in:
parent
3fe5619bcc
commit
04c22dd56e
1 changed files with 5 additions and 5 deletions
|
@ -482,13 +482,13 @@ class SWHListerBase(abc.ABC, config.SWHConfig):
|
|||
Returns:
|
||||
nothing
|
||||
"""
|
||||
def escape_url_path(p):
|
||||
return p.replace('/', '__')
|
||||
datepath = utcnow().isoformat()
|
||||
|
||||
fname = os.path.join(
|
||||
self.config['cache_dir'],
|
||||
escape_url_path(response.request.path_url) + '.gz'
|
||||
)
|
||||
self.config['cache_dir'],
|
||||
datepath + '.gz',
|
||||
)
|
||||
|
||||
with gzip.open(fname, 'w') as f:
|
||||
f.write(bytes(
|
||||
self.transport_response_to_string(response),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue