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

Silence DeprecationWarning by default #51568

Closed
brettcannon opened this issue Nov 14, 2009 · 22 comments
Closed

Silence DeprecationWarning by default #51568

brettcannon opened this issue Nov 14, 2009 · 22 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

BPO 7319
Nosy @brettcannon, @pitrou, @benjaminp, @ezio-melotti, @briancurtin, @florentx
Files
  • silence_deprecations.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/brettcannon'
    closed_at = <Date 2010-06-28.00:05:02.556>
    created_at = <Date 2009-11-14.00:15:51.703>
    labels = ['interpreter-core', 'type-bug', 'release-blocker']
    title = 'Silence DeprecationWarning by default'
    updated_at = <Date 2010-06-28.00:05:02.554>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2010-06-28.00:05:02.554>
    actor = 'benjamin.peterson'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2010-06-28.00:05:02.556>
    closer = 'benjamin.peterson'
    components = ['Interpreter Core']
    creation = <Date 2009-11-14.00:15:51.703>
    creator = 'brett.cannon'
    dependencies = []
    files = ['15770']
    hgrepos = []
    issue_num = 7319
    keywords = ['patch']
    message_count = 22.0
    messages = ['95220', '97189', '97217', '97227', '97243', '97298', '97330', '97344', '97494', '98772', '98777', '100522', '100541', '100544', '101184', '102273', '104174', '104177', '104178', '104180', '104183', '108809']
    nosy_count = 6.0
    nosy_names = ['brett.cannon', 'pitrou', 'benjamin.peterson', 'ezio.melotti', 'brian.curtin', 'flox']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'needs patch'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue7319'
    versions = ['Python 3.2']

    @brettcannon
    Copy link
    Member Author

    This issue is to track the silencing of DeprecationWarning by default.

    To start a patch has been attached against trunk which silences
    DeprecationWarning. Documentation changes are still needed, though.

    @brettcannon brettcannon added release-blocker interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Nov 14, 2009
    @brettcannon
    Copy link
    Member Author

    New patch that includes proposed doc changes.

    @pitrou
    Copy link
    Member

    pitrou commented Jan 4, 2010

    Just FYI, there are tabs in your spaces in _warnings.c.

    @ezio-melotti
    Copy link
    Member

    The second paragraph ("There is also the issue...") is IMO redundant, especially the third sentence ("But because Python is an interpreted language...").

    @briancurtin
    Copy link
    Member

    warnings_rst_reword.diff proposes slightly different wording on the "Updating Code..." section of documentation.

    @brettcannon brettcannon self-assigned this Jan 6, 2010
    @brettcannon
    Copy link
    Member Author

    Thanks for the feedback, everyone. The tabs have been fixed in the source. As for the docs, I moved the explanation as to why the warnings are silenced to the end of the section and chopped the "compilation" reasoning as it is not the critical reason for the silencing.

    @briancurtin
    Copy link
    Member

    The wording of the documentation flows and is arranged better than before.

    However, there is a test failure: test_exceptions.testDeprecatedMessageAttribute depends on the deprecation warning always occuring.
    @unittest.skipIf(DeprecationWarning in [filter[2] for filter in warnings.filters], "DeprecationWarning disabled") or something like that could avoid it.

    @brettcannon
    Copy link
    Member Author

    Latest patch adds fixes to test_exceptions test_ascii_formatd to pass.

    @brettcannon
    Copy link
    Member Author

    Committed in r77402. I am going to wait to see if any doc changes occur before I commit in py3k.

    For historical reasons, here is the thread that hashed out the reasonsing: http://mail.python.org/pipermail/stdlib-sig/2009-November/000789.html

    And thanks to everyone who helped out with this!

    @benjaminp
    Copy link
    Contributor

    Has enough time elapsed yet for py3k merging?

    @brettcannon
    Copy link
    Member Author

    On Tue, Feb 2, 2010 at 19:00, Benjamin Peterson <report@bugs.python.org> wrote:

    Benjamin Peterson <benjamin@python.org> added the comment:

    Has enough time elapsed yet for py3k merging?

    Sure. I will try to do it before or at PyCon.

    @florentx
    Copy link
    Mannequin

    florentx mannequin commented Mar 6, 2010

    The -Qwarn/-Qwarnall options are unexpectedly silenced in 2.7.

    @brettcannon
    Copy link
    Member Author

    So it isn't really unexpected as -Q uses DeprecationWarning which is being silenced by default.

    So either -Q has to turn DeprecationWarning back on or a new subclass of DeprecationWarning (say IntegerDivisionWarning) needs to be introduced that -Q uses and adds to the warnings filter.

    And FYI, I did backport the patch but forgot to close the issue.

    @brettcannon
    Copy link
    Member Author

    Posted to python-dev to solicit feedback on how to handle this.

    @ezio-melotti
    Copy link
    Member

    The silencing of DeprecationWarnings should also be advertised, so that who writes the code knows that now -Wd should be used explicitly while testing the code. A warning in the "What's new" would be a good place where to start.

    @benjaminp
    Copy link
    Contributor

    Lowering priority.

    @brettcannon
    Copy link
    Member Author

    -Q now works like -3 by causing the DeprecationWarning silencing to be skipped. Committed in r80492.

    @benjaminp
    Copy link
    Contributor

    This still hasn't been ported to py3.

    @benjaminp benjaminp reopened this Apr 25, 2010
    @brettcannon
    Copy link
    Member Author

    Making this a 3.2 issue now.

    @benjaminp
    Copy link
    Contributor

    Brett, by the way, you had spurious changes in subprocess in your last commit.

    @brettcannon
    Copy link
    Member Author

    I'm tired of svn. I swear I made sure I didn't list that file in what was changed.

    Anyway, it's been reverted in r80496.

    @benjaminp
    Copy link
    Contributor

    Merged the lot in r82314.

    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants