classification
Title: Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings
Type: Stage: resolved
Components: Tkinter Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cheryl.sabella, gpolo, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2017-09-18 14:09 by vstinner, last changed 2018-02-01 16:49 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3651 merged serhiy.storchaka, 2017-09-19 09:53
PR 3667 merged serhiy.storchaka, 2017-09-20 08:00
PR 3719 merged python-dev, 2017-09-24 11:34
Messages (12)
msg302454 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-09-18 14:09
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')
.
msg302456 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-09-18 14:20
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
msg302458 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-18 14:32
This is a reminder to me to remove a deprecated API (see issue27319).
msg302466 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-09-18 15:58
> This is a reminder to me to remove a deprecated API (see issue27319).

Running tests should not log deprecation warnings.

Either remove the code, or make the warning quiet, no? :-)
msg302576 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2017-09-20 01:03
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.
msg302598 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-20 06:26
Thank you Cheryl. I'll open a separate issue.
msg302600 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-20 07:17
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.
msg302849 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-24 11:34
New changeset 2fad10235460ac394cc8b869c41f47aba3d63594 by Serhiy Storchaka in branch 'master':
bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). (#3667)
https://github.com/python/cpython/commit/2fad10235460ac394cc8b869c41f47aba3d63594
msg302853 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-24 12:03
New changeset e31eca45e548bf6f439d540f3751516acbc31689 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). (GH-3667) (#3719)
https://github.com/python/cpython/commit/e31eca45e548bf6f439d540f3751516acbc31689
msg302855 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-24 12:05
Warnings are fixed in 3.7. They will reappear in 3.8.
msg302856 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-09-24 12:10
Thank you for the fix Serhiy!
msg311450 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-02-01 16:49
New changeset 97f1ca167385bafd9be5d226f61c33412fc081bf by Serhiy Storchaka in branch 'master':
[3.8] bpo-31508: Remove support of arguments in tkinter.ttk.Treeview.selection. (GH-3651)
https://github.com/python/cpython/commit/97f1ca167385bafd9be5d226f61c33412fc081bf
History
Date User Action Args
2018-02-01 16:49:29serhiy.storchakasetmessages: + msg311450
2017-09-24 12:10:05vstinnersetmessages: + msg302856
2017-09-24 12:05:15serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg302855

stage: patch review -> resolved
2017-09-24 12:03:50serhiy.storchakasetmessages: + msg302853
2017-09-24 11:34:20python-devsetpull_requests: + pull_request3703
2017-09-24 11:34:12serhiy.storchakasetmessages: + msg302849
2017-09-20 08:00:44serhiy.storchakasetpull_requests: + pull_request3657
2017-09-20 07:17:09serhiy.storchakasetmessages: + msg302600
2017-09-20 06:26:25serhiy.storchakasetmessages: + msg302598
2017-09-20 01:03:58cheryl.sabellasetnosy: + cheryl.sabella
messages: + msg302576
2017-09-19 09:53:04serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request3644
2017-09-18 15:58:34vstinnersetmessages: + msg302466
2017-09-18 14:32:40serhiy.storchakasetmessages: + msg302458
2017-09-18 14:20:45vstinnersetmessages: + msg302456
2017-09-18 14:09:37vstinnercreate