Limit debug filename to a sane number of characters
This commit is contained in:
parent
c7b055b898
commit
c4b40e85e9
1 changed files with 1 additions and 1 deletions
|
|
@ -155,7 +155,7 @@ class BaseBrowser(object):
|
|||
# try to get an extension (and avoid adding 'None')
|
||||
ext = mimetypes.guess_extension(mimetype, False) or ''
|
||||
|
||||
path = re.sub('[^A-z0-9\.-_]+', '_', urlparse(response.url).path.rpartition('/')[2])
|
||||
path = re.sub('[^A-z0-9\.-_]+', '_', urlparse(response.url).path.rpartition('/')[2])[-10:]
|
||||
if path.endswith(ext):
|
||||
ext = ''
|
||||
filename = '%02d-%d%s%s%s' % \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue