Before opening an issue, being a totally newbie, I’d like to have your opinion on the following issue.
I was asked to do some maintenance on a python software that used a very old version on wxPython.
I did my job and now everything seems OK under debian/linux with py 3.9.2 and wxPy 4.1.1.
I just tried to execute the same software within an equivalent environment under Win10 but it looks like it won’t run. I get the error:
Traceback (most recent call last):
File “C:\Users\xxx\Desktop\stable-4.8-py3\GTB.py”, line 9, in
frame = XrcFrameSubClass()
File “C:\Users\xxx\Desktop\stable-4.8-py3\MinuitFIT.py”, line 57, in init
xrcMAINFRAME.init(self, parent=None)
File “C:\Users\xxx\Desktop\stable-4.8-py3\MinuitFIT_xrc.py”, line 51, in init
self.mnuSave = self.GetMenuBar().FindItemById(xrc.XRCID(“mnuSave”)).GetSubMenu()
AttributeError: ‘NoneType’ object has no attribute ‘GetSubMenu’
Before going through the analysis of the specific errors, I wonder whether it is normal to get this error only under win10 and not in linux.
in Python a method returns None if nothing else is returned; so reading the trace from back to front ‘FindItem…’ returned None which means it did not succeed, i.e. no wx.MenuItem was found… and so on…
Well, yes, I’m a new to wxPython, not that much to Python (though I’m far from being an expert ).
My question was explicitly about the behaviour on different platform: remember that exactly the same code in (hopefully) the same environment does not raises any error.
The fact that specific method returns “None” in win10 and not in debian/linux, puzzles me. I cannot figure out any “reasonable” reason for this (but, of course, there must be some).
I know this is not a trivial question but I verified carefully: not only pip list says wxPython 4.1.1
on both platforms but I also put the line print(wx.__version__)
in the program and reports the same.
I did this to exclude that other packages in the system provide different versions of wxPython, but it seems that this is not the case.