]> granicus.if.org Git - python/commitdiff
Protect logging call against None argument (fixes #11045).
authorÉric Araujo <merwok@netwok.org>
Sat, 29 Jan 2011 20:32:11 +0000 (20:32 +0000)
committerÉric Araujo <merwok@netwok.org>
Sat, 29 Jan 2011 20:32:11 +0000 (20:32 +0000)
Initial patch by Kelsey Hightower.  Approved by Raymond.  A test was
non-trivial to write without calling the private function directly, so
we moved that for later.

Lib/shutil.py
Misc/NEWS

index b8086336cbac32a71ad874c8f51af18be0ca8a18..d47c67c6bcb9f65f9b2a976ef00e85ba41c5201f 100644 (file)
@@ -391,7 +391,8 @@ def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
     archive_dir = os.path.dirname(archive_name)
 
     if not os.path.exists(archive_dir):
-        logger.info("creating %s" % archive_dir)
+        if logger is not None:
+            logger.info("creating %s" % archive_dir)
         if not dry_run:
             os.makedirs(archive_dir)
 
index 66705e66e23b6632c4419398a4936f8ec9002300..ed7e5de35fea9f275accd0f6488159da9873dc4e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #11045: Protect logging call against None argument.
+
 - Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
   commands.