It was checked if files did exists which does not work
for symlinks where the destination file was already
removed.
else:
file = _file.name
- # If the file was removed by the user, we can skip it.
- if not os.path.exists(file):
- continue
-
# Rename configuration files.
if _file.is_config():
file_save = "%s%s" % (file, CONFIG_FILE_SUFFIX_SAVE)
_patterns = [pattern,]
for pattern in _patterns:
- if not os.path.exists(pattern):
+ # Try to stat the pattern. If that is not successful, we cannot go on.
+ try:
+ os.lstat(pattern)
+ except OSError:
continue
# Add directories recursively but skip those symlinks