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

Runtime error with wxPython 4.2.1 #75

Open
mausch opened this issue Jul 16, 2023 · 5 comments
Open

Runtime error with wxPython 4.2.1 #75

mausch opened this issue Jul 16, 2023 · 5 comments

Comments

@mausch
Copy link

mausch commented Jul 16, 2023

Traceback (most recent call last):
  File "/nix/store/s0xx7shngbbkydwbm2g0vv34rj8dzx96-easyabc-1.3.8.6/share/easyabc/easy_abc.py", line 8771, in OnInit
    self.frame = self.NewMainFrame(options)
  File "/nix/store/s0xx7shngbbkydwbm2g0vv34rj8dzx96-easyabc-1.3.8.6/share/easyabc/easy_abc.py", line 8710, in NewMainFrame
    frame = MainFrame(None, 0, self.app_dir, self.settings, options or {})
  File "/nix/store/s0xx7shngbbkydwbm2g0vv34rj8dzx96-easyabc-1.3.8.6/share/easyabc/easy_abc.py", line 3954, in __init__
    self.setup_menus()
  File "/nix/store/s0xx7shngbbkydwbm2g0vv34rj8dzx96-easyabc-1.3.8.6/share/easyabc/easy_abc.py", line 6177, in setup_menus
    append_menu_item(transpose_menu, _('Up %d semitones') % i, '', lambda e, i=i: self.OnTranspose(i))
  File "/nix/store/s0xx7shngbbkydwbm2g0vv34rj8dzx96-easyabc-1.3.8.6/share/easyabc/wxhelper.py", line 32, in append_menu_item
    menu_item = wx.MenuItem(menu, -1, label, description, kind)
TypeError: MenuItem(): argument 2 has unexpected type 'int'

Works fine with wxPython 4.2.0
First reported in NixOS/nixpkgs#243561

@jwdj
Copy link
Owner

jwdj commented Jul 22, 2023

I have upgraded (on Windows) to wxPython 4.2.1 but there the issue is not reproducable. According to the documentation (https://wxpython.org/Phoenix/docs/html/wx.MenuItem.html#wx.MenuItem.__init__) the second argument is supposed to be an int. So I think the problem lies elsewhere.
What Python version are you using?

@kirillrdy
Copy link

I have upgraded (on Windows) to wxPython 4.2.1 but there the issue is not reproducable. According to the documentation (https://wxpython.org/Phoenix/docs/html/wx.MenuItem.html#wx.MenuItem.__init__) the second argument is supposed to be an int. So I think the problem lies elsewhere. What Python version are you using?

I believe its 3.10.12

@mausch
Copy link
Author

mausch commented Jul 26, 2023

The Nix package uses Python 3.9.
EasyABC has other known issues with Python 3.10 ( #52 )

@kirillrdy
Copy link

The Nix package uses Python 3.9. EasyABC has other known issues with Python 3.10 ( #52 )

indeed you are right !

@mausch
Copy link
Author

mausch commented Aug 20, 2023

According to the documentation (https://wxpython.org/Phoenix/docs/html/wx.MenuItem.html#wx.MenuItem.__init__) the second argument is supposed to be an int. So I think the problem lies elsewhere.

Yeah, I'm thinking there's something wrong with the Nix package for wxPython or wxWidgets.
I changed that EasyABC line to say wx.ID_ANY instead of -1 and I get TypeError: MenuItem(): argument 2 has unexpected type 'StandardID'
which is a more googleable error message that led me to https://web.archive.org/web/20230603153021/https://discuss.wxpython.org/t/typeerror-menuitem-argument-2-has-unexpected-type-standardid-when-running-the-demo/36464
in which people suspect of an incorrect wxWidgets build.

I'll see if I can create a small repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants