Hi Reiner!
I did some trivial changes. Please find an attached patch.
This patch closes #818856 and #796262.

Thanks!
Satyam Zode
From 85c062d32b84ed6d8fcf5a80f0d2a2fbb4e43e54 Mon Sep 17 00:00:00 2001
From: Satyam Zode <satyamz...@gmail.com>
Date: Thu, 7 Apr 2016 01:15:04 +0530
Subject: [PATCH] Fixed issue related to diffoscope symlinks crashing (Closes:
 #818856,#796262)

---
 diffoscope/comparators/binary.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/diffoscope/comparators/binary.py b/diffoscope/comparators/binary.py
index 9663214..2b61538 100644
--- a/diffoscope/comparators/binary.py
+++ b/diffoscope/comparators/binary.py
@@ -182,8 +182,8 @@ class File(object, metaclass=ABCMeta):
     def has_same_content_as(self, other):
         logger.debug('%s has_same_content %s', self, other)
         # try comparing small files directly first
-        my_size = os.path.getsize(self.path)
-        other_size = os.path.getsize(other.path)
+        my_size = os.lstat(self.path).st_size
+        other_size = os.lstat(other.path).st_size
         if my_size == other_size and my_size <= SMALL_FILE_THRESHOLD:
             if open(self.path, 'rb').read() == open(other.path, 'rb').read():
                 return True
-- 
2.1.4

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to