mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #4570 (Windows: Error when adding PDF where metadata contains illegal path components)
This commit is contained in:
parent
0377f9b43c
commit
3f98797f21
@ -92,6 +92,8 @@ def sanitize_file_name(name, substitute='_', as_unicode=False):
|
||||
if as_unicode:
|
||||
one = one.decode(filesystem_encoding)
|
||||
one = one.replace('..', substitute)
|
||||
if one.endswith('.'):
|
||||
one = one[:-1]+'_'
|
||||
return one
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user