Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shutil._make_tarball misses a guard against loggger=None #55254

Closed
tarekziade mannequin opened this issue Jan 28, 2011 · 11 comments
Closed

shutil._make_tarball misses a guard against loggger=None #55254

tarekziade mannequin opened this issue Jan 28, 2011 · 11 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@tarekziade
Copy link
Mannequin

tarekziade mannequin commented Jan 28, 2011

BPO 11045
Nosy @freddrake, @birkenfeld, @rhettinger, @tarekziade, @merwok
Files
  • distutils2_logger.info_bug.txt: Full stacktrace
  • check-logger-is-none.patch
  • fix-11045.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/merwok'
    closed_at = <Date 2011-11-20.14:32:40.073>
    created_at = <Date 2011-01-28.13:48:09.593>
    labels = ['type-bug', 'library']
    title = 'shutil._make_tarball misses a guard against loggger=None'
    updated_at = <Date 2011-11-20.14:32:40.072>
    user = 'https://github.com/tarekziade'

    bugs.python.org fields:

    activity = <Date 2011-11-20.14:32:40.072>
    actor = 'eric.araujo'
    assignee = 'eric.araujo'
    closed = True
    closed_date = <Date 2011-11-20.14:32:40.073>
    closer = 'eric.araujo'
    components = ['Library (Lib)']
    creation = <Date 2011-01-28.13:48:09.593>
    creator = 'tarek'
    dependencies = []
    files = ['20574', '20609', '20610']
    hgrepos = []
    issue_num = 11045
    keywords = ['patch']
    message_count = 11.0
    messages = ['127300', '127301', '127302', '127473', '127476', '127478', '127480', '127483', '127484', '127860', '147992']
    nosy_count = 8.0
    nosy_names = ['fdrake', 'georg.brandl', 'rhettinger', 'paulsmith', 'tarek', 'eric.araujo', 'v_peter', 'kelsey.hightower']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11045'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @tarekziade
    Copy link
    Mannequin Author

    tarekziade mannequin commented Jan 28, 2011

    This line : logger.info("creating %s" % archive_dir)

    should check that logger is not None before being called..

    @tarekziade tarekziade mannequin self-assigned this Jan 28, 2011
    @tarekziade tarekziade mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 28, 2011
    @tarekziade
    Copy link
    Mannequin Author

    tarekziade mannequin commented Jan 28, 2011

    will fix + write patch

    @kelseyhightower
    Copy link
    Mannequin

    kelseyhightower mannequin commented Jan 28, 2011

    Adding stacktrace to ticket

    @kelseyhightower
    Copy link
    Mannequin

    kelseyhightower mannequin commented Jan 29, 2011

    Adding patch to ticket

    @merwok
    Copy link
    Member

    merwok commented Jan 29, 2011

    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.

    @rhettinger
    Copy link
    Contributor

    Please apply right away.

    @rhettinger
    Copy link
    Contributor

    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).

    @merwok
    Copy link
    Member

    merwok commented Jan 29, 2011

    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.

    @merwok merwok assigned merwok and unassigned tarekziade Jan 29, 2011
    @merwok
    Copy link
    Member

    merwok commented Jan 29, 2011

    Fixed for 3.2rc2 in r88240. Would it be right to call the internal function in the test?

    @merwok
    Copy link
    Member

    merwok commented Feb 4, 2011

    Arg, bpo-9173 had a patch including a test. Not sure which bug is superseded by the other.

    @merwok
    Copy link
    Member

    merwok commented Nov 20, 2011

    This was fixed in 615a29295d5f.

    @merwok merwok closed this as completed Nov 20, 2011
    @merwok merwok changed the title shutil._make_tarball shutil._make_tarball misses a guard against loggger=None Nov 20, 2011
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants