Title: Certain Tkinter tests fail on Tk 8.7 due to TIP 577 · Issue #104855 · python/cpython · GitHub
Open Graph Title: Certain Tkinter tests fail on Tk 8.7 due to TIP 577 · Issue #104855 · python/cpython
X Title: Certain Tkinter tests fail on Tk 8.7 due to TIP 577 · Issue #104855 · python/cpython
Description: One of the broader effects of TIP 577 on Tk 8.7 (and to a greater degree under Tcl 9.0 than Tcl 8.7) is that it makes widget commands/options/etc. more consistent about using empty string as the reserved “none” value, rather than e.g. "n...
Open Graph Description: One of the broader effects of TIP 577 on Tk 8.7 (and to a greater degree under Tcl 9.0 than Tcl 8.7) is that it makes widget commands/options/etc. more consistent about using empty string as the re...
X Description: One of the broader effects of TIP 577 on Tk 8.7 (and to a greater degree under Tcl 9.0 than Tcl 8.7) is that it makes widget commands/options/etc. more consistent about using empty string as the re...
Opengraph URL: https://github.com/python/cpython/issues/104855
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Certain Tkinter tests fail on Tk 8.7 due to TIP 577","articleBody":"One of the broader effects of [TIP 577](https://core.tcl-lang.org/tips/doc/trunk/tip/577.md) on Tk 8.7 (and to a greater degree under Tcl 9.0 than Tcl 8.7) is that it makes widget commands/options/etc. more consistent about using empty string as the reserved “none” value, rather than e.g. `\"none\"` or `-1`. python/cpython#103685 was one instance of this.\r\n\r\nSeveral options already accepted the empty string under Tk 8.6, but this was not reflected in the `bad option…` error messages. Tk 8.7 corrects this, which breaks several Tkinter tests with hardcoded error messages:\r\n\r\n```\r\n======================================================================\r\nFAIL: test_place_configure_relheight (test.test_tkinter.test_geometry_managers.PlaceTest.test_place_configure_relheight)\r\n----------------------------------------------------------------------\r\n_tkinter.TclError: expected floating-point number or \"\" but got \"abcd\"\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/test_geometry_managers.py\", line 426, in test_place_configure_relheight\r\n with self.assertRaisesRegex(TclError, 'expected floating-point number '\r\nAssertionError: \"expected floating-point number but got \"abcd\"\" does not match \"expected floating-point number or \"\" but got \"abcd\"\"\r\n\r\n======================================================================\r\nFAIL: test_place_configure_relwidth (test.test_tkinter.test_geometry_managers.PlaceTest.test_place_configure_relwidth)\r\n----------------------------------------------------------------------\r\n_tkinter.TclError: expected floating-point number or \"\" but got \"abcd\"\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/test_geometry_managers.py\", line 414, in test_place_configure_relwidth\r\n with self.assertRaisesRegex(TclError, 'expected floating-point number '\r\nAssertionError: \"expected floating-point number but got \"abcd\"\" does not match \"expected floating-point number or \"\" but got \"abcd\"\"\r\n\r\n======================================================================\r\nFAIL: test_configure_overrelief (test.test_tkinter.test_widgets.ButtonTest.test_configure_overrelief)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 448, in test_configure_overrelief\r\n self.checkReliefParam(widget, 'overrelief')\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 161, in checkReliefParam\r\n self.checkInvalidParam(widget, name, 'spam',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 63, in checkInvalidParam\r\n self.assertEqual(str(cm.exception), errmsg)\r\nAssertionError: 'bad relief \"spam\": must be flat, groove, raised, ridge, solid, sunken, or \"\"' != 'bad relief \"spam\": must be flat, groove, raised, ridge, solid, or sunken'\r\n- bad relief \"spam\": must be flat, groove, raised, ridge, solid, sunken, or \"\"\r\n? -------\r\n+ bad relief \"spam\": must be flat, groove, raised, ridge, solid, or sunken\r\n? +++\r\n\r\n======================================================================\r\nFAIL: test_configure_overrelief (test.test_tkinter.test_widgets.CheckbuttonTest.test_configure_overrelief)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 448, in test_configure_overrelief\r\n self.checkReliefParam(widget, 'overrelief')\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 161, in checkReliefParam\r\n self.checkInvalidParam(widget, name, 'spam',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 63, in checkInvalidParam\r\n self.assertEqual(str(cm.exception), errmsg)\r\nAssertionError: 'bad relief \"spam\": must be flat, groove, raised, ridge, solid, sunken, or \"\"' != 'bad relief \"spam\": must be flat, groove, raised, ridge, solid, or sunken'\r\n- bad relief \"spam\": must be flat, groove, raised, ridge, solid, sunken, or \"\"\r\n? -------\r\n+ bad relief \"spam\": must be flat, groove, raised, ridge, solid, or sunken\r\n? +++\r\n\r\n======================================================================\r\nFAIL: test_configure_proxyrelief (test.test_tkinter.test_widgets.PanedWindowTest.test_configure_proxyrelief)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/support.py\", line 94, in newtest\r\n test(self)\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/test_widgets.py\", line 1245, in test_configure_proxyrelief\r\n self.checkReliefParam(widget, 'proxyrelief')\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 161, in checkReliefParam\r\n self.checkInvalidParam(widget, name, 'spam',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 63, in checkInvalidParam\r\n self.assertEqual(str(cm.exception), errmsg)\r\nAssertionError: 'bad relief \"spam\": must be flat, groove, raised, ridge, solid, sunken, or \"\"' != 'bad relief \"spam\": must be flat, groove, raised, ridge, solid, or sunken'\r\n- bad relief \"spam\": must be flat, groove, raised, ridge, solid, sunken, or \"\"\r\n? -------\r\n+ bad relief \"spam\": must be flat, groove, raised, ridge, solid, or sunken\r\n? +++\r\n\r\n======================================================================\r\nFAIL: test_configure_overrelief (test.test_tkinter.test_widgets.RadiobuttonTest.test_configure_overrelief)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 448, in test_configure_overrelief\r\n self.checkReliefParam(widget, 'overrelief')\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 161, in checkReliefParam\r\n self.checkInvalidParam(widget, name, 'spam',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 63, in checkInvalidParam\r\n self.assertEqual(str(cm.exception), errmsg)\r\nAssertionError: 'bad relief \"spam\": must be flat, groove, raised, ridge, solid, sunken, or \"\"' != 'bad relief \"spam\": must be flat, groove, raised, ridge, solid, or sunken'\r\n- bad relief \"spam\": must be flat, groove, raised, ridge, solid, sunken, or \"\"\r\n? -------\r\n+ bad relief \"spam\": must be flat, groove, raised, ridge, solid, or sunken\r\n? +++\r\n```\r\n\r\nIn a few other cases, empty string has become a valid input, so tests which expect an exception to be raised now fail instead:\r\n\r\n```\r\n======================================================================\r\nFAIL: test_configure_underline (test.test_tkinter.test_widgets.ButtonTest.test_configure_underline)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 418, in test_configure_underline\r\n self.checkIntegerParam(widget, 'underline', 0, 1, 10)\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 77, in checkIntegerParam\r\n self.checkInvalidParam(widget, name, '',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 60, in checkInvalidParam\r\n with self.assertRaises(tkinter.TclError) as cm:\r\nAssertionError: TclError not raised\r\n\r\n======================================================================\r\nFAIL: test_configure_underline (test.test_tkinter.test_widgets.CheckbuttonTest.test_configure_underline)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 418, in test_configure_underline\r\n self.checkIntegerParam(widget, 'underline', 0, 1, 10)\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 77, in checkIntegerParam\r\n self.checkInvalidParam(widget, name, '',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 60, in checkInvalidParam\r\n with self.assertRaises(tkinter.TclError) as cm:\r\nAssertionError: TclError not raised\r\n\r\n======================================================================\r\nFAIL: test_configure_underline (test.test_tkinter.test_widgets.LabelTest.test_configure_underline)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 418, in test_configure_underline\r\n self.checkIntegerParam(widget, 'underline', 0, 1, 10)\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 77, in checkIntegerParam\r\n self.checkInvalidParam(widget, name, '',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 60, in checkInvalidParam\r\n with self.assertRaises(tkinter.TclError) as cm:\r\nAssertionError: TclError not raised\r\n\r\n======================================================================\r\nFAIL: test_configure_underline (test.test_tkinter.test_widgets.MenubuttonTest.test_configure_underline)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 418, in test_configure_underline\r\n self.checkIntegerParam(widget, 'underline', 0, 1, 10)\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 77, in checkIntegerParam\r\n self.checkInvalidParam(widget, name, '',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 60, in checkInvalidParam\r\n with self.assertRaises(tkinter.TclError) as cm:\r\nAssertionError: TclError not raised\r\n\r\n======================================================================\r\nFAIL: test_configure_underline (test.test_tkinter.test_widgets.OptionMenuTest.test_configure_underline)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 418, in test_configure_underline\r\n self.checkIntegerParam(widget, 'underline', 0, 1, 10)\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 77, in checkIntegerParam\r\n self.checkInvalidParam(widget, name, '',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 60, in checkInvalidParam\r\n with self.assertRaises(tkinter.TclError) as cm:\r\nAssertionError: TclError not raised\r\n\r\n======================================================================\r\nFAIL: test_configure_underline (test.test_tkinter.test_widgets.RadiobuttonTest.test_configure_underline)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 418, in test_configure_underline\r\n self.checkIntegerParam(widget, 'underline', 0, 1, 10)\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 77, in checkIntegerParam\r\n self.checkInvalidParam(widget, name, '',\r\n File \"/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py\", line 60, in checkInvalidParam\r\n with self.assertRaises(tkinter.TclError) as cm:\r\nAssertionError: TclError not raised\r\n```\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-105047\n* gh-120824\n* gh-120864\n* gh-120865\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/chrstphrchvz","@type":"Person","name":"chrstphrchvz"},"datePublished":"2023-05-24T11:15:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/104855/cpython/issues/104855"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a8c16808-cdd7-2b3e-d46d-bdf9d88805f8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9976:26E310:7BC4E0:A8CC41:6969DBF6 |
| html-safe-nonce | 41fdd45fcf5573954079dbf7990b7e9a8c69307472ba3df1e4e801f8bd54fd0e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTc2OjI2RTMxMDo3QkM0RTA6QThDQzQxOjY5NjlEQkY2IiwidmlzaXRvcl9pZCI6IjY3MTIxOTI1NTcxNTc4MzM3MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 969183902f8acfc8b7ee2821bca596e00d46f994e609e3adc1d5d263f8aca6b4 |
| hovercard-subject-tag | issue:1723748135 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/104855/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f3b944c3280ec257e6ee2996c555ef5d5a4a67f1e4db318beec3e091ab6cfeac/python/cpython/issues/104855 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f3b944c3280ec257e6ee2996c555ef5d5a4a67f1e4db318beec3e091ab6cfeac/python/cpython/issues/104855 |
| og:image:alt | One of the broader effects of TIP 577 on Tk 8.7 (and to a greater degree under Tcl 9.0 than Tcl 8.7) is that it makes widget commands/options/etc. more consistent about using empty string as the re... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chrstphrchvz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width