mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1919388 [Private bug](https://bugs.launchpad.net/calibre/+bug/1919388)
This commit is contained in:
parent
8b4d27a75b
commit
73a8699e0a
@ -20,6 +20,7 @@ from polyglot.builtins import unicode_type, zip, getcwd, as_unicode
|
|||||||
|
|
||||||
def sanitize_file_name(x):
|
def sanitize_file_name(x):
|
||||||
ans = re.sub(r'\s+', ' ', re.sub(r'[?&=;#]', '_', ascii_filename(x))).strip().rstrip('.')
|
ans = re.sub(r'\s+', ' ', re.sub(r'[?&=;#]', '_', ascii_filename(x))).strip().rstrip('.')
|
||||||
|
ans = re.sub(r'\%2[fF]', '_', ans)
|
||||||
ans, ext = ans.rpartition('.')[::2]
|
ans, ext = ans.rpartition('.')[::2]
|
||||||
return (ans.strip() + '.' + ext.strip()).rstrip('.')
|
return (ans.strip() + '.' + ext.strip()).rstrip('.')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user