[Git][reproducible-builds/diffoscope][master] Don't crash when listing entries in archives if they don't have a listed size...

Chris Lamb gitlab at salsa.debian.org
Thu Jul 2 09:42:20 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
0846ae8f by Chris Lamb at 2020-07-02T10:42:11+01:00
Don't crash when listing entries in archives if they don't have a listed size (eg. hardlinks in .ISO files). (Closes: reproducible-builds/diffoscope#188)

- - - - -


1 changed file:

- diffoscope/comparators/utils/libarchive.py


Changes:

=====================================
diffoscope/comparators/utils/libarchive.py
=====================================
@@ -3,7 +3,7 @@
 # diffoscope: in-depth comparison of files, archives, and directories
 #
 # Copyright © 2015 Jérémy Bobbio <lunar at debian.org>
-# Copyright © 2016-2019 Chris Lamb <lamby at debian.org>
+# Copyright © 2016-2020 Chris Lamb <lamby at debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -139,7 +139,7 @@ def list_libarchive(path, ignore_errors=False):
                         major=entry.rdevmajor, minor=entry.rdevminor
                     )
                 else:
-                    size_or_dev = entry.size
+                    size_or_dev = "-" if entry.size is None else entry.size
                 mtime = time.strftime(
                     "%Y-%m-%d %H:%M:%S", time.gmtime(entry.mtime)
                 ) + ".{:06d}".format(entry.mtime_nsec // 1000)



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/0846ae8f08de5113d2035212b6a146d27beaf9de

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/0846ae8f08de5113d2035212b6a146d27beaf9de
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200702/463f22d7/attachment.htm>


More information about the rb-commits mailing list