[diffoscope] 01/01: Mask more warnings (eg. "readelf: Error: the dynamic segment offset + size exceeds the size of the file") in ELF comparator.

Chris Lamb chris at chris-lamb.co.uk
Sat Aug 20 22:51:19 CEST 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 39143ec1ca9832f7ab6612c1aea0988025aa56f4
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Aug 20 21:51:08 2016 +0100

    Mask more warnings (eg. "readelf: Error: the dynamic segment offset + size exceeds the size of the file") in ELF comparator.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/comparators/elf.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/diffoscope/comparators/elf.py b/diffoscope/comparators/elf.py
index 4cb0fca..e769613 100644
--- a/diffoscope/comparators/elf.py
+++ b/diffoscope/comparators/elf.py
@@ -297,7 +297,7 @@ class ElfStringSection(ElfSection):
 @tool_required('readelf')
 def get_build_id(path):
     try:
-        output = subprocess.check_output(['readelf', '--notes', path])
+        output = subprocess.check_output(['readelf', '--notes', path], stderr=subprocess.DEVNULL)
     except subprocess.CalledProcessError as e:
         logger.debug('Unable to get Build Id for %s: %s', path, e)
         return None
@@ -310,7 +310,7 @@ def get_build_id(path):
 @tool_required('readelf')
 def get_debug_link(path):
     try:
-        output = subprocess.check_output(['readelf', '--string-dump=.gnu_debuglink', path])
+        output = subprocess.check_output(['readelf', '--string-dump=.gnu_debuglink', path], stderr=subprocess.DEVNULL)
     except subprocess.CalledProcessError as e:
         logger.debug('Unable to get Build Id for %s: %s', path, e)
         return None
@@ -328,7 +328,7 @@ class ElfContainer(Container):
         super().__init__(*args, **kwargs)
         logger.debug('creating ElfContainer for file %s', self.source.path)
         cmd = ['readelf', '--wide', '--section-headers', self.source.path]
-        output = subprocess.check_output(cmd, shell=False)
+        output = subprocess.check_output(cmd, shell=False, stderr=subprocess.DEVNULL)
         has_debug_symbols = False
         try:
             output = output.decode('utf-8').split('\n')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list