From: Éric Araujo Date: Sat, 29 Jan 2011 20:32:11 +0000 (+0000) Subject: Protect logging call against None argument (fixes #11045). X-Git-Tag: v3.2rc2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac4e58eb610f7da80396f5c5e0a5d5d15bf0cc3f;p=python Protect logging call against None argument (fixes #11045). 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. --- diff --git a/Lib/shutil.py b/Lib/shutil.py index b8086336cb..d47c67c6bc 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -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) diff --git a/Misc/NEWS b/Misc/NEWS index 66705e66e2..ed7e5de35f 100644 --- 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.