From 43fcdf8ca958e699cd91e1082b78a6a293326665 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Mar 2011 09:24:55 -0700 Subject: [PATCH] Replace leading period in filenames with an underscore --- src/calibre/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index 221f5911c6..716e3913fb 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -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