From 32c5e03322894e3fcd990d9ba6f4365b30aadc4f Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 6 Feb 2015 23:32:10 +0100 Subject: ext.shutil_generatorized: don't follow links in copystat This avoids error messages when copying broken links, and seems like a sane setting overall. Especially considering that ranger has no option to follow links when copying. --- ranger/ext/shutil_generatorized.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/ext/shutil_generatorized.py b/ranger/ext/shutil_generatorized.py index 2df04926..b20d5cef 100644 --- a/ranger/ext/shutil_generatorized.py +++ b/ranger/ext/shutil_generatorized.py @@ -79,7 +79,7 @@ def copyfile(src, dst): def copystat(src, dst): """Copy all stat info (mode bits, atime, mtime, flags) from src to dst""" - st = os.stat(src) + st = os.lstat(src) mode = stat.S_IMODE(st.st_mode) if hasattr(os, 'utime'): try: os.utime(dst, (st.st_atime, st.st_mtime)) -- cgit 1.4.1-2-gfad0