From 9311bdcaf4f26939252e89e5b2d3c5fcab52d755 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 23 Sep 2010 09:02:07 +0000 Subject: Do not store symlinks #2362 --- diff --git a/src/carquinyol/filestore.py b/src/carquinyol/filestore.py index 9724397..9eb975f 100644 --- a/src/carquinyol/filestore.py +++ b/src/carquinyol/filestore.py @@ -43,6 +43,14 @@ class FileStore(object): if file_path: if not os.path.isfile(file_path): raise ValueError('No file at %r' % file_path) + + if os.path.islink(file_path): + # Can't keep symlinks (especially pointed to removable medias). + # Later, optimizer will help with saving duplicates + file_path = os.path.realpath(file_path) + # We should not move original file + transfer_ownership = False + if transfer_ownership: try: logging.debug('FileStore moving from %r to %r', file_path, -- cgit v0.9.1