Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude .DS_Store from local_backups cleanup #26

Open
davebuilt opened this issue Jun 29, 2020 · 0 comments
Open

Exclude .DS_Store from local_backups cleanup #26

davebuilt opened this issue Jun 29, 2020 · 0 comments

Comments

@davebuilt
Copy link

davebuilt commented Jun 29, 2020

The app crashes when it encounters a file that isn't a directory inside the local_backups folder.

This is fine usually but on macOS the system occasionally inserts .DS_Store files.

You need to filter to just directories for the cleanup or specifically ignore .DS_Store files.

Traceback (most recent call last):
  File "PPP.py", line 542, in <module>
    backupLocal()
  File "PPP.py", line 380, in backupLocal
    'local_backups', backups[oldest_backup]))
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 494, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 413, in _rmtree_safe_fd
    onerror(os.scandir, path, sys.exc_info())
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 409, in _rmtree_safe_fd
    with os.scandir(topfd) as scandir_it:
NotADirectoryError: [Errno 20] Not a directory: 'local_backups/.DS_Store'

P.S. I love this tool, thanks for making it! If my Python was better I would submit a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant