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

buildbot: DeprecationWarning not raised for icglue (test_py3kwarn.TestStdlibRemovals) #52693

Closed
vstinner opened this issue Apr 18, 2010 · 7 comments
Assignees
Labels
OS-mac tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

BPO 8446
Nosy @ronaldoussoren, @mdickinson, @vstinner, @florentx
Files
  • issue8446_icglue_webbrowser.diff: Patch, apply to 2.x
  • 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/ronaldoussoren'
    closed_at = <Date 2010-06-27.12:55:23.037>
    created_at = <Date 2010-04-18.22:12:36.376>
    labels = ['OS-mac', 'type-bug', 'tests']
    title = 'buildbot: DeprecationWarning not raised for icglue (test_py3kwarn.TestStdlibRemovals)'
    updated_at = <Date 2010-06-27.12:55:23.036>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2010-06-27.12:55:23.036>
    actor = 'ronaldoussoren'
    assignee = 'ronaldoussoren'
    closed = True
    closed_date = <Date 2010-06-27.12:55:23.037>
    closer = 'ronaldoussoren'
    components = ['macOS', 'Tests']
    creation = <Date 2010-04-18.22:12:36.376>
    creator = 'vstinner'
    dependencies = []
    files = ['17384']
    hgrepos = []
    issue_num = 8446
    keywords = ['patch', 'buildbot']
    message_count = 7.0
    messages = ['103537', '103546', '105942', '106340', '106344', '106765', '108346']
    nosy_count = 5.0
    nosy_names = ['ronaldoussoren', 'mark.dickinson', 'janssen', 'vstinner', 'flox']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue8446'
    versions = ['Python 2.7']

    @vstinner
    Copy link
    Member Author

    http://www.python.org/dev/buildbot/builders/x86 Tiger trunk/builds/15/steps/test/logs/stdio

    test_py3kwarn
    test test_py3kwarn failed -- Traceback (most recent call last):
      File "/Users/db3l/buildarea/trunk.bolen-tiger/build/Lib/test/test_py3kwarn.py", line 387, in test_platform_specific_removals
        self.check_removal(module_name, optional=True)
      File "/Users/db3l/buildarea/trunk.bolen-tiger/build/Lib/test/test_py3kwarn.py", line 376, in check_removal
        .format(module_name))
    AssertionError: DeprecationWarning not raised for icglue

    Re-running test 'test_py3kwarn' in verbose mode
    test_backquote (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_buffer (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_builtin_function_or_method_comparisons (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_cell_inequality_comparisons (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_code_inequality_comparisons (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_dict_inequality_comparisons (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_file_xreadlines (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_forbidden_names (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_frame_attributes (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_hash_inheritance (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_methods_members (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_object_inequality_comparisons (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_operator (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_paren_arg_names (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_slice_methods (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_softspace (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_sort_cmp_arg (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_sys_exc_clear (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_tuple_parameter_unpacking (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_type_inequality_comparisons (test.test_py3kwarn.TestPy3KWarnings) ... ok
    test_mutablestring_removal (test.test_py3kwarn.TestStdlibRemovals) ... ok
    test_optional_module_removals (test.test_py3kwarn.TestStdlibRemovals) ... ok
    test_os_path_walk (test.test_py3kwarn.TestStdlibRemovals) ... ok
    test_platform_independent_removals (test.test_py3kwarn.TestStdlibRemovals) ... ok
    test_platform_specific_removals (test.test_py3kwarn.TestStdlibRemovals) ... FAIL
    test_reduce_move (test.test_py3kwarn.TestStdlibRemovals) ... ok

    ======================================================================
    FAIL: test_platform_specific_removals (test.test_py3kwarn.TestStdlibRemovals)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/Users/db3l/buildarea/trunk.bolen-tiger/build/Lib/test/test_py3kwarn.py", line 387, in test_platform_specific_removals
        self.check_removal(module_name, optional=True)
      File "/Users/db3l/buildarea/trunk.bolen-tiger/build/Lib/test/test_py3kwarn.py", line 376, in check_removal
        .format(module_name))
    AssertionError: DeprecationWarning not raised for icglue

    @vstinner
    Copy link
    Member Author

    Mac/Modules/icgluemodule.c has a call to PyErr_WarnPy3k

    if (PyErr_WarnPy3k("In 3.x, the icglue module is removed.", 1))
    return;

    Other modules check if the result is smaller than 0, but PyErr_WarnPy3k() possible results are only 0 or -1, so I don't understand the error.

    @vstinner vstinner added the tests Tests in the Lib/test dir label Apr 18, 2010
    @florentx
    Copy link
    Mannequin

    florentx mannequin commented May 17, 2010

    Maybe this is due to webbrowser dependency on "ic" module.

    Patch not tested.

    @florentx florentx mannequin added the OS-mac label May 17, 2010
    @florentx florentx mannequin assigned ronaldoussoren May 17, 2010
    @florentx florentx mannequin added the type-bug An unexpected behavior, bug, or error label May 17, 2010
    @janssen
    Copy link
    Mannequin

    janssen mannequin commented May 23, 2010

    Not sure I understand this patch. Either the icglue module is removed in python 3, in which case it should raise the deprecation warning, or it is not, in which case it should be removed from the list of modules checked in test_py3kwarn. Shouldn't the patch also address one of these two cases?

    @ronaldoussoren
    Copy link
    Contributor

    The patch somewhat works, in that it makes test_py3kwarn pass but I'd add more filterwarning calls:

            filterwarnings("ignore", ".*the icglue module is removed",
                DeprecationWarning)
            filterwarnings("ignore", ".*the MacOS module is removed",
                DeprecationWarning)
            filterwarnings("ignore", ".*the macostools module is removed",
                DeprecationWarning)

    This ensures that importing webbrowser won't trigger py3k warnings.

    It is probably safe to remove the import of 'ic' and related code the block with guard "if sys.platform == 'darwin'" just below that overrides the IC based browser detection by one that doesn't use IC (that one is added to the front of the search list, which means the IC one never gets used).

    @ronaldoussoren
    Copy link
    Contributor

    The root cause of this test failure is that test_macos runs before test_py3kwarn.

    That causes MacOS to be imported before test_py3k runs and that results in not raising the py3k warning by the time test_py3kwarn runs.

    I propose removing MacOS from the list of modules that test_py3kwarn tests for now.

    @ronaldoussoren
    Copy link
    Contributor

    This should be fixed with r82149.

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

    No branches or pull requests

    2 participants