[Python-checkins] cpython (3.4): Issue #25280: Import trace messages emitted in verbose (-v) mode are no

serhiy.storchaka python-checkins at python.org
Thu Oct 1 04:57:05 EDT 2015


https://hg.python.org/cpython/rev/da42b38f7470
changeset:   98458:da42b38f7470
branch:      3.4
parent:      98455:83dc79eeaf7f
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Thu Oct 01 11:08:50 2015 +0300
summary:
  Issue #25280: Import trace messages emitted in verbose (-v) mode are no
longer formatted twice.

files:
  Lib/importlib/_bootstrap.py |    8 +-
  Misc/NEWS                   |    3 +
  Python/importlib.h          |  115 ++++++++++++-----------
  3 files changed, 65 insertions(+), 61 deletions(-)


diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -620,15 +620,15 @@
     raw_size = data[8:12]
     if magic != MAGIC_NUMBER:
         message = 'bad magic number in {!r}: {!r}'.format(name, magic)
-        _verbose_message(message)
+        _verbose_message('{}', message)
         raise ImportError(message, **exc_details)
     elif len(raw_timestamp) != 4:
         message = 'reached EOF while reading timestamp in {!r}'.format(name)
-        _verbose_message(message)
+        _verbose_message('{}', message)
         raise EOFError(message)
     elif len(raw_size) != 4:
         message = 'reached EOF while reading size of source in {!r}'.format(name)
-        _verbose_message(message)
+        _verbose_message('{}', message)
         raise EOFError(message)
     if source_stats is not None:
         try:
@@ -638,7 +638,7 @@
         else:
             if _r_long(raw_timestamp) != source_mtime:
                 message = 'bytecode is stale for {!r}'.format(name)
-                _verbose_message(message)
+                _verbose_message('{}', message)
                 raise ImportError(message, **exc_details)
         try:
             source_size = source_stats['size'] & 0xFFFFFFFF
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@
 Core and Builtins
 -----------------
 
+- Issue #25280: Import trace messages emitted in verbose (-v) mode are no
+  longer formatted twice.
+
 - Issue #25003: os.urandom() doesn't use getentropy() on Solaris because
   getentropy() is blocking, whereas os.urandom() should not block. getentropy()
   is supported since Solaris 11.3.
diff --git a/Python/importlib.h b/Python/importlib.h
--- a/Python/importlib.h
+++ b/Python/importlib.h
[stripped]

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list