]> granicus.if.org Git - python/commitdiff
Issue #25280: Import trace messages emitted in verbose (-v) mode are no
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 1 Oct 2015 08:55:52 +0000 (11:55 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 1 Oct 2015 08:55:52 +0000 (11:55 +0300)
longer formatted twice.

1  2 
Lib/importlib/_bootstrap_external.py
Misc/NEWS

index abde6d9afec55ec3ceda065a52827ca56b9d75df,616b17f89a82d198c43acceb2dc88e6b9010b9ff..e0a1200547bd51d249b471c19fa31d79ae55f910
@@@ -429,15 -437,15 +429,15 @@@ def _validate_bytecode_header(data, sou
      raw_size = data[8:12]
      if magic != MAGIC_NUMBER:
          message = 'bad magic number in {!r}: {!r}'.format(name, magic)
-         _bootstrap._verbose_message(message)
 -        _verbose_message('{}', message)
++        _bootstrap._verbose_message('{}', message)
          raise ImportError(message, **exc_details)
      elif len(raw_timestamp) != 4:
          message = 'reached EOF while reading timestamp in {!r}'.format(name)
-         _bootstrap._verbose_message(message)
 -        _verbose_message('{}', message)
++        _bootstrap._verbose_message('{}', message)
          raise EOFError(message)
      elif len(raw_size) != 4:
          message = 'reached EOF while reading size of source in {!r}'.format(name)
-         _bootstrap._verbose_message(message)
 -        _verbose_message('{}', message)
++        _bootstrap._verbose_message('{}', message)
          raise EOFError(message)
      if source_stats is not None:
          try:
          else:
              if _r_long(raw_timestamp) != source_mtime:
                  message = 'bytecode is stale for {!r}'.format(name)
-                 _bootstrap._verbose_message(message)
 -                _verbose_message('{}', message)
++                _bootstrap._verbose_message('{}', message)
                  raise ImportError(message, **exc_details)
          try:
              source_size = source_stats['size'] & 0xFFFFFFFF
diff --cc Misc/NEWS
index a1aa269c70acffdb790a94a8b87478bc24fd203a,354e9ec1d14b5b62d5a1a8117b2b5198d77fa8ca..68c0be198cb896c19a206b42b263b0199c343afe
+++ b/Misc/NEWS
@@@ -10,10 -11,9 +10,13 @@@ Release date: XXXX-XX-X
  Core and Builtins
  -----------------
  
+ - Issue #25280: Import trace messages emitted in verbose (-v) mode are no
+   longer formatted twice.
 +- Issue #25227: Optimize ASCII and latin1 encoders with the ``surrogateescape``
 +  error handler: the encoders are now up to 3 times as fast. Initial patch
 +  written by Serhiy Storchaka.
 +
  - Issue #25003: On Solaris 11.3 or newer, os.urandom() now uses the
    getrandom() function instead of the getentropy() function. The getentropy()
    function is blocking to generate very good quality entropy, os.urandom()