Skip to content

tkinter messagebox is sloppy #82830

Closed
Closed

Description

@lambertdw
mannequin
BPO 38649
Nosy @serhiy-storchaka, @lambertdw

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/serhiy-storchaka'
closed_at = None
created_at = <Date 2019-10-30.19:37:05.672>
labels = ['type-feature', 'tests', '3.10', 'docs']
title = 'tkinter messagebox is sloppy'
updated_at = <Date 2020-12-25.21:56:35.834>
user = 'https://github.com/lambertdw'

bugs.python.org fields:

activity = <Date 2020-12-25.21:56:35.834>
actor = 'serhiy.storchaka'
assignee = 'serhiy.storchaka'
closed = False
closed_date = None
closer = None
components = ['Documentation', 'Tests']
creation = <Date 2019-10-30.19:37:05.672>
creator = 'David Lambert'
dependencies = []
files = []
hgrepos = []
issue_num = 38649
keywords = []
message_count = 4.0
messages = ['355729', '355762', '360092', '383769']
nosy_count = 3.0
nosy_names = ['docs@python', 'serhiy.storchaka', 'David Lambert']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue38649'
versions = ['Python 3.10']

Linked PRs

Activity

  1. lambertdw commented on Oct 30, 2019

    lambertdwmannequin
    MannequinAuthor

    Does aksokcancel return "true" or True ? The docstring should say True This is pervasive throughout the module. tkinter has such a mishmash of numbers supplied as strings, strings supplied as constants making this carelessness egregious. On the topic of constants, the messagebox module redefines OK. You might argue that the definition didn't change. I suspect this issue applies to all versions of tkinter or Tkinter having the messagebox.

    # types
    ABORTRETRYIGNORE = "abortretryignore"
    OK = "ok"
    ...

    # replies
    ...
    OK = "ok"

    def askokcancel(title=None, message=None, **options):
        "Ask if operation should proceed; return true if the answer is ok"
        s = _show(title, message, QUESTION, OKCANCEL, **options)
        return s == OK
  2. added
    docsDocumentation in the Doc dir
    type-featureA feature request or enhancement
    on Oct 30, 2019
  3. brettcannon commented on Oct 31, 2019

    @brettcannon
    Member

    Please note that calling something "sloppy" and that somehow its development was done in some "carelessness" fashion to the point of being "egregious" is not motivating to others to try and help. Trying to support all of this code for free in one's spare time is not easy, so I would ask you try to be more understanding and nicer in your comments.

  4. lambertdw commented on Jan 16, 2020

    lambertdwmannequin
    MannequinAuthor

    Sometimes I say nice things about python.

    https://www.quora.com/Is-Python-fast-yet/answer/David-Lambert-86?__nsrc__=4&__snid3__=6376944631

    On 10/31/19 1:14 PM, Brett Cannon wrote:

    Brett Cannon <brett@python.org> added the comment:

    Please note that calling something "sloppy" and that somehow its development was done in some "carelessness" fashion to the point of being "egregious" is not motivating to others to try and help. Trying to support all of this code for free in one's spare time is not easy, so I would ask you try to be more understanding and nicer in your comments.

    ----------
    nosy: +brett.cannon


    Python tracker <report@bugs.python.org>
    <https://bugs.python.org/issue38649\>


  5. serhiy-storchaka commented on Dec 25, 2020

    @serhiy-storchaka
    Member

    I agree that there is a problem. tkinter.messagebox is poorly documented. Different functions can return True, False, None or the name of the button, and it is not specified which function what returns. Set of acceptable values for type and icon are not documented. And there are no tests, so we cannot be sure that all works as expected on all platforms.

    I am working on it.

  6. transferred this issue fromon Apr 10, 2022
  7. serhiy-storchaka commented on Jun 27, 2026

    @serhiy-storchaka
    Member

    PR #152380 corrects the messagebox.ask* docstrings to say they return True (not "true"), notes that askquestion returns the symbolic button name, and fixes askretrycancel to say "retry". (The OK "redefinition" is intentional — the option type and the reply share the value "ok".)

  8. added a commit that references this issue on Jun 27, 2026
  9. added 3 commits that reference this issue on Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

docsDocumentation in the Doc dirtestsTests in the Lib/test dirtopic-tkintertype-featureA feature request or enhancement

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions