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

logging module __init__ uses has_key #48773

Closed
bitdancer opened this issue Dec 4, 2008 · 4 comments
Closed

logging module __init__ uses has_key #48773

bitdancer opened this issue Dec 4, 2008 · 4 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@bitdancer
Copy link
Member

BPO 4523
Nosy @birkenfeld, @vstinner, @benjaminp, @bitdancer
Files
  • logging_py3k.patch
  • 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/birkenfeld'
    closed_at = <Date 2008-12-14.01:46:33.009>
    created_at = <Date 2008-12-04.14:19:01.046>
    labels = ['type-bug', 'library']
    title = 'logging module __init__ uses has_key'
    updated_at = <Date 2008-12-14.01:46:32.985>
    user = 'https://github.com/bitdancer'

    bugs.python.org fields:

    activity = <Date 2008-12-14.01:46:32.985>
    actor = 'benjamin.peterson'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2008-12-14.01:46:33.009>
    closer = 'benjamin.peterson'
    components = ['Library (Lib)']
    creation = <Date 2008-12-04.14:19:01.046>
    creator = 'r.david.murray'
    dependencies = []
    files = ['12217']
    hgrepos = []
    issue_num = 4523
    keywords = ['patch']
    message_count = 4.0
    messages = ['76883', '76885', '76886', '77773']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'vstinner', 'benjamin.peterson', 'r.david.murray']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue4523'
    versions = ['Python 2.6']

    @bitdancer
    Copy link
    Member Author

    I ran my ap with -3 and got the following:

    /usr/lib/python2.6/logging/init.py:849: DeprecationWarning:
    dict.has_key() not supported in 3.x; use the in operator

    @bitdancer bitdancer added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Dec 4, 2008
    @vstinner
    Copy link
    Member

    vstinner commented Dec 4, 2008

    The regression tests are already running with -bb. We should also
    use -3 to detect such bug. But is "-3" enough to raise an error (and
    not just display a message)?

    @vstinner
    Copy link
    Member

    vstinner commented Dec 4, 2008

    I tried the whole Python test suite with -3. Some warnings:

    • no more cPikle and bsddb modules
    • has_key() (used in many tests)
    • a <> b (used in many AST/grammar tests)
    • an exception have to inherit from Exception
    • callable() doesn't exist anymore
    • etc.

    It's not a good idea to fix the regression tests because Python 2.6
    still uses the listed features. But the logging warning should be
    fixed, so here is a patch.

    @benjaminp
    Copy link
    Contributor

    Fixed in r67748.

    @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

    4 participants