This commit is contained in:
Kovid Goyal 2010-01-15 10:03:31 -07:00
parent fb967276d5
commit 46a1b04528

View File

@ -92,6 +92,7 @@ def sanitize_file_name(name, substitute='_', as_unicode=False):
if as_unicode: if as_unicode:
one = one.decode(filesystem_encoding) one = one.decode(filesystem_encoding)
one = one.replace('..', substitute) one = one.replace('..', substitute)
# Windows doesn't like path components that end with a period
if one.endswith('.'): if one.endswith('.'):
one = one[:-1]+'_' one = one[:-1]+'_'
return one return one