Hi Satyam!

Thanks for submitting a patch for this issue!

On Sun, Apr 03, 2016 at 02:08:52AM +0530, Satyam Zode wrote:
>          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)
> +        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

Here you change only the other_size line, not my_size.
When other.path is a broken symlink, this will work (and diffoscope
doesn't crash).
But self.path could also be a broken symlink (if you reverse the
diffoscope arguments, `diffoscope bar foo`). In this case diffoscope
would crash with the same problem.

Can you please amend your patch to fix this also?

Kind regards,

Attachment: signature.asc
Description: Digital signature

Reproducible-builds mailing list

Reply via email to