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

os.stat fails when src_file is a symlink #83

Open
bill-mcgonigle opened this issue Jun 7, 2017 · 0 comments
Open

os.stat fails when src_file is a symlink #83

bill-mcgonigle opened this issue Jun 7, 2017 · 0 comments

Comments

@bill-mcgonigle
Copy link

Apparently I made a symlink 14 years ago and sortphotos threw an error when it hit it. Removed the symlink and everything proceeded as expected (thank you!).

Just ignoring symlinks would be fine from my perspective.

[1178/2164]
Source: /pictures/2003/Passport Photos/P1010009.JPG
Date/Time: 2003-09-26 22:01:20
Corresponding Tags: EXIF:ModifyDate
Destination (move): /pictures/by-date/2003/09/26/P1010009.JPG
Traceback (most recent call last):
  File "/usr/bin/sortphotos", line 9, in <module>
    load_entry_point('sortphotos==1.0', 'console_scripts', 'sortphotos')()
  File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 490, in main
    args.use_only_tags, not args.silent)
  File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 398, in sortPhotos
    if remove_duplicates and filecmp.cmp(src_file, dest_compare):  # check for identical files
  File "/usr/lib64/python2.7/filecmp.py", line 42, in cmp
    s1 = _sig(os.stat(f1))
OSError: [Errno 2] No such file or directory: '/pictures/2003/Passport Photos/P1010009.JPG'
$ ls -l '/storagemcg/pictures/2003/Passport Photos/P1010009.JPG'
lrwxrwxrwx 1 flowerpt 2001 29 Aug 28  2014 /pictures/2003/Passport Photos/P1010009.JPG -> ../../2003/09/26/P1010009.JPG
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