[Reproducible-builds] [reproducible/diffoscope.git: PATCH 4/5] Leave string interpolation to logging.$level(..) calls

Chris Lamb lamby at debian.org
Thu Aug 20 20:05:17 UTC 2015


Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/comparators/__init__.py  | 4 ++--
 diffoscope/comparators/bzip2.py     | 2 +-
 diffoscope/comparators/device.py    | 2 +-
 diffoscope/comparators/directory.py | 2 +-
 diffoscope/comparators/gzip.py      | 2 +-
 diffoscope/comparators/haskell.py   | 2 +-
 diffoscope/comparators/symlink.py   | 2 +-
 diffoscope/comparators/xz.py        | 2 +-
 diffoscope/difference.py            | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/diffoscope/comparators/__init__.py b/diffoscope/comparators/__init__.py
index fa8bd5c..1eba63d 100644
--- a/diffoscope/comparators/__init__.py
+++ b/diffoscope/comparators/__init__.py
@@ -67,7 +67,7 @@ def compare_root_paths(path1, path2):
 
 
 def compare_files(file1, file2, source=None):
-    logger.debug('compare files %s and %s' % (file1, file2))
+    logger.debug('compare files %s and %s', file1, file2)
     with file1.get_content(), file2.get_content():
         if file1.has_same_content_as(file2):
             logger.debug('same content, skipping')
@@ -122,7 +122,7 @@ def specialize(file):
             new_cls = type(cls.__name__, (cls, type(file)), {})
             file.__class__ = new_cls
             return file
-    logger.debug('Unidentified file. Magic says: %s' % file.magic_file_type)
+    logger.debug('Unidentified file. Magic says: %s', file.magic_file_type)
     return file
 
 
diff --git a/diffoscope/comparators/bzip2.py b/diffoscope/comparators/bzip2.py
index 6356716..9b6f383 100644
--- a/diffoscope/comparators/bzip2.py
+++ b/diffoscope/comparators/bzip2.py
@@ -44,7 +44,7 @@ class Bzip2Container(Archive):
     @tool_required('bzip2')
     def extract(self, member_name, dest_dir):
         dest_path = os.path.join(dest_dir, member_name)
-        logger.debug('bzip2 extracting to %s' % dest_path)
+        logger.debug('bzip2 extracting to %s', dest_path)
         with open(dest_path, 'wb') as fp:
             subprocess.check_call(
                 ["bzip2", "--decompress", "--stdout", self.path],
diff --git a/diffoscope/comparators/device.py b/diffoscope/comparators/device.py
index ce23e47..bfaa310 100644
--- a/diffoscope/comparators/device.py
+++ b/diffoscope/comparators/device.py
@@ -47,7 +47,7 @@ class Device(File):
 
     @needs_content
     def compare(self, other, source=None):
-        logger.debug('my_content %s' % self.path)
+        logger.debug('my_content %s', self.path)
         with open(self.path) as my_content, \
              open(other.path) as other_content:
             return Difference.from_file(my_content, other_content, self.name, other.name, source=source, comment="symlink")
diff --git a/diffoscope/comparators/directory.py b/diffoscope/comparators/directory.py
index e7a468d..77c882b 100644
--- a/diffoscope/comparators/directory.py
+++ b/diffoscope/comparators/directory.py
@@ -70,7 +70,7 @@ class Getfacl(Command):
 
 
 def compare_meta(path1, path2):
-    logger.debug('compare_meta(%s, %s)' % (path1, path2))
+    logger.debug('compare_meta(%s, %s)', path1, path2)
     differences = []
     try:
         differences.append(Difference.from_command(Stat, path1, path2))
diff --git a/diffoscope/comparators/gzip.py b/diffoscope/comparators/gzip.py
index b4c1c9d..fb99c84 100644
--- a/diffoscope/comparators/gzip.py
+++ b/diffoscope/comparators/gzip.py
@@ -45,7 +45,7 @@ class GzipContainer(Archive):
     @tool_required('gzip')
     def extract(self, member_name, dest_dir):
         dest_path = os.path.join(dest_dir, member_name)
-        logger.debug('gzip extracting to %s' % dest_path)
+        logger.debug('gzip extracting to %s', dest_path)
         with open(dest_path, 'wb') as fp:
             subprocess.check_call(
                 ["gzip", "--decompress", "--stdout", self.path],
diff --git a/diffoscope/comparators/haskell.py b/diffoscope/comparators/haskell.py
index 495607d..8ee9977 100644
--- a/diffoscope/comparators/haskell.py
+++ b/diffoscope/comparators/haskell.py
@@ -59,7 +59,7 @@ class HiFile(File):
                 buf = fp.read(32)
                 magic = struct.unpack_from('!I', buf)[0]
                 if magic != HI_MAGIC:
-                    logger.debug('Haskell interface magic mismatch. Found %d instead of %d' % (magic, HI_MAGIC))
+                    logger.debug('Haskell interface magic mismatch. Found %d instead of %d', magic, HI_MAGIC)
                     return False
                 # XXX: what is second field for?
                 version_found = map(unichr, struct.unpack_from('<I4xIB', buf, 16))
diff --git a/diffoscope/comparators/symlink.py b/diffoscope/comparators/symlink.py
index b243278..aa50372 100644
--- a/diffoscope/comparators/symlink.py
+++ b/diffoscope/comparators/symlink.py
@@ -46,7 +46,7 @@ class Symlink(File):
 
     @needs_content
     def compare(self, other, source=None):
-        logger.debug('my_content %s' % self.path)
+        logger.debug('my_content %s', self.path)
         with open(self.path) as my_content, \
              open(other.path) as other_content:
             return Difference.from_file(my_content, other_content, self.name, other.name, source=source, comment="symlink")
diff --git a/diffoscope/comparators/xz.py b/diffoscope/comparators/xz.py
index 26955dd..f14a2f7 100644
--- a/diffoscope/comparators/xz.py
+++ b/diffoscope/comparators/xz.py
@@ -44,7 +44,7 @@ class XzContainer(Archive):
     @tool_required('xz')
     def extract(self, member_name, dest_dir):
         dest_path = os.path.join(dest_dir, member_name)
-        logger.debug('xz extracting to %s' % dest_path)
+        logger.debug('xz extracting to %s', dest_path)
         with open(dest_path, 'wb') as fp:
             subprocess.check_call(
                 ["xz", "--decompress", "--stdout", self.path],
diff --git a/diffoscope/difference.py b/diffoscope/difference.py
index 28328eb..502ffae 100644
--- a/diffoscope/difference.py
+++ b/diffoscope/difference.py
@@ -180,7 +180,7 @@ class ExThread(Thread):
             return
         else:
             except_type, except_class, tb = ex_info
-            logger.debug('Exception: %s' %
+            logger.debug('Exception: %s',
                          traceback.format_exception_only(except_type, except_class)[0].strip())
             logger.debug('Traceback:')
             for line in traceback.format_list(tb):
-- 
2.5.0




More information about the Reproducible-builds mailing list