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

Tk 8.7: TIP 577 breaks tkinter.Menu.index() #103685

Closed
Tracked by #104568
chrstphrchvz opened this issue Apr 22, 2023 · 1 comment
Closed
Tracked by #104568

Tk 8.7: TIP 577 breaks tkinter.Menu.index() #103685

chrstphrchvz opened this issue Apr 22, 2023 · 1 comment
Labels
stdlib Python modules in the Lib dir topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@chrstphrchvz
Copy link
Contributor

chrstphrchvz commented Apr 22, 2023

Bug report

One effect of TIP 577 is that as of Tk 8.7, the index command for menus will now return an empty string instead of none, leading to an error in tkinter.Menu.index():

>>> m.index('none')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/git/cpython/Lib/tkinter/__init__.py", line 3434, in index
    return self.tk.getint(i)
           ^^^^^^^^^^^^^^^^^
_tkinter.TclError: expected integer but got ""

It should be easy to accommodate both the new and old behavior.

Linked PRs

@chrstphrchvz chrstphrchvz added the type-bug An unexpected behavior, bug, or error label Apr 22, 2023
chrstphrchvz added a commit to chrstphrchvz/cpython that referenced this issue Apr 22, 2023
@arhadthedev arhadthedev added topic-tkinter stdlib Python modules in the Lib dir labels Apr 22, 2023
terryjreedy added a commit that referenced this issue Apr 24, 2023
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 24, 2023
---------

(cherry picked from commit f0ed293)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
terryjreedy added a commit that referenced this issue Apr 24, 2023
…03734)

gh-103685: Fix tkinter.Menu.index() for Tk 8.7 (GH-103686)

---------

(cherry picked from commit f0ed293)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
@terryjreedy
Copy link
Member

Thanks for making a start on preparing for 8.7+ & 9.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants