diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index 347799de64..6faa021151 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -92,6 +92,7 @@ def sanitize_file_name(name, substitute='_', as_unicode=False): if as_unicode: one = one.decode(filesystem_encoding) one = one.replace('..', substitute) + # Windows doesn't like path components that end with a period if one.endswith('.'): one = one[:-1]+'_' return one