|
|
@ -208,7 +208,7 @@ def sanitize_filename(s, restricted=False):
|
|
|
|
return '_-' if restricted else ' -'
|
|
|
|
return '_-' if restricted else ' -'
|
|
|
|
elif char in '\\/|*<>':
|
|
|
|
elif char in '\\/|*<>':
|
|
|
|
return '_'
|
|
|
|
return '_'
|
|
|
|
if restricted and (char in '&\'' or char.isspace()):
|
|
|
|
if restricted and (char in '!&\'' or char.isspace()):
|
|
|
|
return '_'
|
|
|
|
return '_'
|
|
|
|
if restricted and ord(char) > 127:
|
|
|
|
if restricted and ord(char) > 127:
|
|
|
|
return '_'
|
|
|
|
return '_'
|
|
|
@ -316,7 +316,7 @@ class ContentTooShortError(Exception):
|
|
|
|
|
|
|
|
|
|
|
|
class Trouble(Exception):
|
|
|
|
class Trouble(Exception):
|
|
|
|
"""Trouble helper exception
|
|
|
|
"""Trouble helper exception
|
|
|
|
|
|
|
|
|
|
|
|
This is an exception to be handled with
|
|
|
|
This is an exception to be handled with
|
|
|
|
FileDownloader.trouble
|
|
|
|
FileDownloader.trouble
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|