Replace leading period in filenames with an underscore

This commit is contained in:
Kovid Goyal 2011-03-06 09:24:55 -07:00
parent bcdd6d474a
commit 43fcdf8ca9

View File

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