This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: shutil._make_tarball misses a guard against loggger=None
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: eric.araujo, fdrake, georg.brandl, kelsey.hightower, paulsmith, rhettinger, tarek, v_peter
Priority: normal Keywords: patch

Created on 2011-01-28 13:48 by tarek, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
distutils2_logger.info_bug.txt kelsey.hightower, 2011-01-28 13:57 Full stacktrace
check-logger-is-none.patch kelsey.hightower, 2011-01-29 19:29 review
fix-11045.diff eric.araujo, 2011-01-29 19:37 review
Messages (11)
msg127300 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2011-01-28 13:48
This line : logger.info("creating %s" % archive_dir)

should check that logger is not None before being called..
msg127301 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2011-01-28 13:48
will fix + write patch
msg127302 - (view) Author: Kelsey (kelsey.hightower) Date: 2011-01-28 13:57
Adding stacktrace to ticket
msg127473 - (view) Author: Kelsey (kelsey.hightower) Date: 2011-01-29 19:29
Adding patch to ticket
msg127476 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-01-29 19:37
I’ve checked the code and this is the only place where logger.* is not protected by a check for None.  There is no unit test, though.

My patch adds two things: Make one formatting call lazy (use logging.info(one, two) instead of one % two), lower-case one message for consistent output).  If we want to be ultra-conservative, Kelsey’s patch is to be preferred.
msg127478 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-01-29 19:45
Please apply right away.
msg127480 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-01-29 19:57
For 3.2, just make the one-line fix.  I'm worry that a test may be hard to get right and would be a risk in and of itself this late in the release cycle.

For the backports, a test would be nice (since we have time to fix a test if it turns out to be problematic).
msg127483 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-01-29 20:25
Indeed, I tried writing a small test to go into the faulty code path, but without calling the private function directly it’s not trivial.

I’ll apply the minimal change shortly if there is no opposition from Georg.
msg127484 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-01-29 20:34
Fixed for 3.2rc2 in r88240.  Would it be right to call the internal function in the test?
msg127860 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-04 02:46
Arg, #9173 had a patch including a test.  Not sure which bug is superseded by the other.
msg147992 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-20 14:32
This was fixed in 615a29295d5f.
History
Date User Action Args
2022-04-11 14:57:12adminsetgithub: 55254
2011-11-20 14:32:40eric.araujosetstatus: open -> closed
title: shutil._make_tarball -> shutil._make_tarball misses a guard against loggger=None
messages: + msg147992

resolution: accepted -> fixed
stage: needs patch -> resolved
2011-02-04 02:46:51eric.araujosetnosy: + fdrake, paulsmith, v_peter
messages: + msg127860
2011-01-29 20:34:40eric.araujosetstatus: pending -> open
priority: high -> normal

messages: + msg127484
nosy: georg.brandl, rhettinger, tarek, eric.araujo, kelsey.hightower
2011-01-29 20:25:01eric.araujosetstatus: open -> pending

messages: + msg127483
assignee: tarek -> eric.araujo
nosy: georg.brandl, rhettinger, tarek, eric.araujo, kelsey.hightower
2011-01-29 19:57:54rhettingersetnosy: georg.brandl, rhettinger, tarek, eric.araujo, kelsey.hightower
messages: + msg127480
2011-01-29 19:46:12rhettingersetnosy: georg.brandl, rhettinger, tarek, eric.araujo, kelsey.hightower
versions: + Python 3.1, Python 3.2
2011-01-29 19:45:59rhettingersetversions: - Python 3.1, Python 3.2, Python 3.3
nosy: + rhettinger

messages: + msg127478

resolution: accepted
2011-01-29 19:37:19eric.araujosetfiles: + fix-11045.diff
nosy: + georg.brandl
messages: + msg127476

2011-01-29 19:29:21kelsey.hightowersetfiles: + check-logger-is-none.patch

messages: + msg127473
keywords: + patch
nosy: tarek, eric.araujo, kelsey.hightower
2011-01-29 17:42:49eric.araujosetnosy: + eric.araujo
2011-01-28 13:57:44kelsey.hightowersetfiles: + distutils2_logger.info_bug.txt
nosy: + kelsey.hightower
messages: + msg127302

2011-01-28 13:48:45tareksetmessages: + msg127301
stage: needs patch
2011-01-28 13:48:09tarekcreate