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

get rid of warnings in regrtest with -3 #46654

Closed
bethard mannequin opened this issue Mar 18, 2008 · 5 comments
Closed

get rid of warnings in regrtest with -3 #46654

bethard mannequin opened this issue Mar 18, 2008 · 5 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@bethard
Copy link
Mannequin

bethard mannequin commented Mar 18, 2008

BPO 2402
Nosy @benjaminp

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 = None
closed_at = <Date 2008-08-21.14:52:48.669>
created_at = <Date 2008-03-18.19:12:36.109>
labels = ['interpreter-core', 'type-bug', 'tests']
title = 'get rid of warnings in regrtest with -3'
updated_at = <Date 2008-08-21.14:52:48.668>
user = 'https://bugs.python.org/bethard'

bugs.python.org fields:

activity = <Date 2008-08-21.14:52:48.668>
actor = 'benjamin.peterson'
assignee = 'none'
closed = True
closed_date = <Date 2008-08-21.14:52:48.669>
closer = 'benjamin.peterson'
components = ['Interpreter Core', 'Tests']
creation = <Date 2008-03-18.19:12:36.109>
creator = 'bethard'
dependencies = []
files = []
hgrepos = []
issue_num = 2402
keywords = []
message_count = 5.0
messages = ['63967', '63985', '63989', '63994', '71645']
nosy_count = 3.0
nosy_names = ['bethard', 'quentin.gallet-gilles', 'benjamin.peterson']
pr_nums = []
priority = 'critical'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue2402'
versions = ['Python 2.6']

@bethard
Copy link
Mannequin Author

bethard mannequin commented Mar 18, 2008

Running the test suite with -3 enabled issues a load of warnings. The
Python 2.6 library should not issue any py3k warnings.

@bethard bethard mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 18, 2008
@benjaminp
Copy link
Contributor

No, *correct usage* of the stdlib should not result in Py3k warnings.
Old APIs should still be tested, which I suppose is part of the reason
that there are so many warnings from testing.

@bethard
Copy link
Mannequin Author

bethard mannequin commented Mar 18, 2008

Fair enough. I agree that the deprecated APIs should still be tested.
But there are a lot of other warnings, e.g. where the standard lib uses
has_key instead of in. These should be removed. The only
warnings should be those that are actively testing deprecated APIs.

Testing of deprecated APIs should probably temporarily suppress the Py3K
warnings while they're executing, though that's not really crucial.

Reducing the flood of warnings is really worthwhile -- I just fixed a
bug in test_atexit which only appeared when -3 was supplied.

@benjaminp
Copy link
Contributor

I made a little decorator which silences py3k warnings. It could be
useful for test.test_support.

def silence_py3k(func):
    def decorator(*args, **kwargs):
        warnings.simplefilter("ignore", warnings.DeprecationWarning)
        func(*args, **kwargs)
        warnings.simplefilter("default", warnings.DeprecationWarning)
    if sys.flags_py3kwarning:
        return decorator
    else:
        return func

@benjaminp benjaminp added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Mar 22, 2008
@benjaminp
Copy link
Contributor

Brett has been doing this.

@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) tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant