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

Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings #75689

Closed
vstinner opened this issue Sep 18, 2017 · 12 comments
Labels

Comments

@vstinner
Copy link
Member

BPO 31508
Nosy @vstinner, @serhiy-storchaka, @csabella
PRs
  • [3.8] bpo-31508: Remove support of arguments in tkinter.ttk.Treeview.selection. #3651
  • bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). #3667
  • [3.6] bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). (GH-3667) #3719
  • 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 2017-09-24.12:05:15.793>
    created_at = <Date 2017-09-18.14:09:37.028>
    labels = ['3.7', 'expert-tkinter']
    title = 'Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings'
    updated_at = <Date 2018-02-01.16:49:29.694>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2018-02-01.16:49:29.694>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-09-24.12:05:15.793>
    closer = 'serhiy.storchaka'
    components = ['Tkinter']
    creation = <Date 2017-09-18.14:09:37.028>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31508
    keywords = ['patch']
    message_count = 12.0
    messages = ['302454', '302456', '302458', '302466', '302576', '302598', '302600', '302849', '302853', '302855', '302856', '311450']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'gpolo', 'serhiy.storchaka', 'cheryl.sabella']
    pr_nums = ['3651', '3667', '3719']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue31508'
    versions = ['Python 3.7']

    @vstinner
    Copy link
    Member Author

    0:33:11 load avg: 4.82 [ 44/405/1] test_ttk_guionly passed -- running: test_subprocess (504 sec)
    /buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed
    'Deprecated API of Treeview.selection() should be removed')
    beginning 6 repetitions
    123456
    /buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed
    'Deprecated API of Treeview.selection() should be removed')
    ./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed
    'Deprecated API of Treeview.selection() should be removed')
    ./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed
    'Deprecated API of Treeview.selection() should be removed')
    ./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed
    'Deprecated API of Treeview.selection() should be removed')
    ./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed
    'Deprecated API of Treeview.selection() should be removed')
    ./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed
    'Deprecated API of Treeview.selection() should be removed')
    .

    @vstinner
    Copy link
    Member Author

    I saw these warnings on:
    http://buildbot.python.org/all/builders/x86%20Gentoo%20Refleaks%203.x/builds/96/steps/test/logs/stdio

    Extract of the pythoninfo:

    tkinter.TCL_VERSION: 8.6
    tkinter.TK_VERSION: 8.6
    tkinter.info_patchlevel: 8.6.6

    --

    I can reproduce the warning locally:

    test_selection (tkinter.test.test_ttk.test_widgets.TreeviewTest) ... /home/haypo/prog/python/master/Lib/tkinter/test/test_ttk/test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed
    'Deprecated API of Treeview.selection() should be removed')
    ok

    @serhiy-storchaka
    Copy link
    Member

    This is a reminder to me to remove a deprecated API (see bpo-27319).

    @vstinner
    Copy link
    Member Author

    This is a reminder to me to remove a deprecated API (see bpo-27319).

    Running tests should not log deprecation warnings.

    Either remove the code, or make the warning quiet, no? :-)

    @csabella
    Copy link
    Contributor

    Serhiy,

    In tkinter __init__.py, there's messages on trace_variable and other trace functions about adding a deprecation warning. I didn't know if you intended to make those changes as well.

    @serhiy-storchaka
    Copy link
    Member

    Thank you Cheryl. I'll open a separate issue.

    @serhiy-storchaka
    Copy link
    Member

    Oh, I missed that the selection() method with its current behavior is documented in the module documentation. It isn't undocumented implementation detail. This raises a bar for removing higher.

    I think it is better to defer removing to 3.8 or later. Instead we should document the deprecation.

    @serhiy-storchaka
    Copy link
    Member

    New changeset 2fad102 by Serhiy Storchaka in branch 'master':
    bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). (bpo-3667)
    2fad102

    @serhiy-storchaka
    Copy link
    Member

    New changeset e31eca4 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
    [3.6] bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). (GH-3667) (bpo-3719)
    e31eca4

    @serhiy-storchaka
    Copy link
    Member

    Warnings are fixed in 3.7. They will reappear in 3.8.

    @vstinner
    Copy link
    Member Author

    Thank you for the fix Serhiy!

    @serhiy-storchaka
    Copy link
    Member

    New changeset 97f1ca1 by Serhiy Storchaka in branch 'master':
    [3.8] bpo-31508: Remove support of arguments in tkinter.ttk.Treeview.selection. (GH-3651)
    97f1ca1

    @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
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants