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

Restore deleted tkinter functions with deprecaton dummies. #66259

Closed
LitaCho mannequin opened this issue Jul 24, 2014 · 9 comments
Closed

Restore deleted tkinter functions with deprecaton dummies. #66259

LitaCho mannequin opened this issue Jul 24, 2014 · 9 comments
Assignees
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@LitaCho
Copy link
Mannequin

LitaCho mannequin commented Jul 24, 2014

BPO 22061
Nosy @terryjreedy, @serhiy-storchaka
Files
  • tk_menubar_fix.patch
  • tkinter_restore_empty_methods.patch
  • turtledemo_menu.patch
  • 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 = <Date 2014-07-25.10:12:54.627>
    created_at = <Date 2014-07-24.21:43:23.770>
    labels = ['type-bug', 'expert-tkinter']
    title = 'Restore deleted tkinter functions with deprecaton dummies.'
    updated_at = <Date 2014-07-25.10:12:54.626>
    user = 'https://bugs.python.org/LitaCho'

    bugs.python.org fields:

    activity = <Date 2014-07-25.10:12:54.626>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-07-25.10:12:54.627>
    closer = 'serhiy.storchaka'
    components = ['Tkinter']
    creation = <Date 2014-07-24.21:43:23.770>
    creator = 'Lita.Cho'
    dependencies = []
    files = ['36076', '36083', '36084']
    hgrepos = []
    issue_num = 22061
    keywords = ['patch']
    message_count = 9.0
    messages = ['223899', '223901', '223918', '223922', '223925', '223928', '223929', '223931', '223933']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'jesstess', 'python-dev', 'serhiy.storchaka', 'Lita.Cho']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue22061'
    versions = ['Python 3.4', 'Python 3.5']

    @LitaCho
    Copy link
    Mannequin Author

    LitaCho mannequin commented Jul 24, 2014

    I updated my source code, and it looks like turtledemo doesn't launch anymore. I get the following error:

    Traceback (most recent call last):
      File "/Users/litacho/Development/cpython/Lib/runpy.py", line 170, in _run_module_as_main
        "__main__", mod_spec)
      File "/Users/litacho/Development/cpython/Lib/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/Users/litacho/Development/cpython/Lib/turtledemo/__main__.py", line 328, in <module>
        main()
      File "/Users/litacho/Development/cpython/Lib/turtledemo/__main__.py", line 324, in main
        demo = DemoWindow()
      File "/Users/litacho/Development/cpython/Lib/turtledemo/__main__.py", line 124, in __init__
        self.mBar.tk_menuBar(self.ExamplesBtn, self.OptionsBtn)
    AttributeError: 'Frame' object has no attribute 'tk_menuBar'

    I dug into it and it looks like tk_menuBar was removed due to a fix in bpo-4350. If tk_menuBar needs to be removed, what method does turtledemo need to call instead to propagate its panels?

    @LitaCho LitaCho mannequin added the type-crash A hard crash of the interpreter, possibly with a core dump label Jul 24, 2014
    @LitaCho
    Copy link
    Mannequin Author

    LitaCho mannequin commented Jul 24, 2014

    Looks like this method was not doing anything. I removed it and the demo is working just fine. Here is a patch.

    @serhiy-storchaka
    Copy link
    Member

    Indeed, unlike to other removed methods which raised an exception, removing this doing nothing method can break existing code. We should restore it and add deprecation warning.

    Of course the use of obsolete method should be removed from turtledemo.

    @serhiy-storchaka serhiy-storchaka added topic-tkinter type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Jul 25, 2014
    @serhiy-storchaka
    Copy link
    Member

    Here is a patch which replaces obsolete and non-working menu creation code by modernized code. Now menu should be correctly displayed on MacOS.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 25, 2014

    New changeset 3c4d45f73622 by Terry Jan Reedy in branch '2.7':
    Issue bpo-22061: remove call of useless function slated for removal.
    http://hg.python.org/cpython/rev/3c4d45f73622

    New changeset 976f31b2858b by Terry Jan Reedy in branch '3.4':
    Issue bpo-22061: remove call of useless function slated for removal.
    http://hg.python.org/cpython/rev/976f31b2858b

    New changeset 9e9e6e9f4cce by Terry Jan Reedy in branch 'default':
    Issue bpo-22061: remove call of useless function slated for removal.
    http://hg.python.org/cpython/rev/9e9e6e9f4cce

    @terryjreedy
    Copy link
    Member

    The turtledemo part of this issue is over. (Lita, tracebacks are not 'crash' issues. Segfaults and the Windows equivalent are.)

    The restoration patch could have been attached to 4350. But since it is here, I retitled this issue instead of closing it. Patch looks good to me.

    Turtledemo menus are a different issue. I opened bpo-22065 and plan to post a revised patch there.

    @terryjreedy terryjreedy changed the title turtledemo doesn't launch due to changes in tkinter Restore deleted tkinter functions with deprecaton dummies. Jul 25, 2014
    @serhiy-storchaka
    Copy link
    Member

    May be add deprecation warnings in 2.7 and 3.4? This method's calls can be left in existing user code as in turtledemo and this code behaves differently from how it was designed and behaved with Tk <4.0. As far as now this methods are empty, this bug can be unnoticed long time.

    @terryjreedy
    Copy link
    Member

    Since Deprecation warnings are off by default, backporting seems like a good idea. There was talk on pydev about adding more py3 warnings to 2.7, which this essentially is (though the removal is delated to 3.6).

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 25, 2014

    New changeset f7c84674bdec by Serhiy Storchaka in branch '2.7':
    Issue bpo-22061: Add deprecation warnings in empty obsolete methods.
    http://hg.python.org/cpython/rev/f7c84674bdec

    New changeset a50297e793f9 by Serhiy Storchaka in branch '3.4':
    Issue bpo-22061: Add deprecation warnings in empty obsolete methods.
    http://hg.python.org/cpython/rev/a50297e793f9

    New changeset 7e6beea0eeab by Serhiy Storchaka in branch 'default':
    Issue bpo-22061: Restored empty obsolete methods removed in issue bpo-4350 and
    http://hg.python.org/cpython/rev/7e6beea0eeab

    @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
    topic-tkinter type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants