GitExl / WhackEd4

As a replacement for the DOS-based Dehacked, WhackEd4 allows you to load and edit Doom Dehacked files.
http://www.teamhellspawn.com/exl/whacked4
BSD 2-Clause "Simplified" License
43 stars 7 forks source link

ZDaemon configuration: Selecting the "Render style" and "Game" drop-down boxs and picking an option crashes WhackEd. #35

Closed Acts19quiz closed 4 months ago

Acts19quiz commented 1 year ago

Version 1.2.3 through 1.3.0 beta 2

OS Windows 10 64-bit LTSC

Installed Python version 3.11.1 64-bit

Description In the ZDaemon configuration, selecting the "Render style" or "Game" drop-down menus and selecting any option crashes WhackEd with the below error. The last version that this crash doesn't happen in is 1.2.1.

C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:242: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:244: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:246: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:248: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:250: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:252: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:254: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:256: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:258: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:2423: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:3667: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:3669: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:4077: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
C:\GitHub\WhackEd4\src\whacked4\ui\windows.py:4079: wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.
Traceback (most recent call last):
  File "C:\GitHub\WhackEd4\src\whacked4\ui\editors\thingsframe.py", line 594, in set_renderstyle
TypeError: 'dict_keys' object is not subscriptable
Acts19quiz commented 1 year ago

After experimenting with the commit history and testing some compiled builds, I've found the root cause of this isn't anything particular with the code, but in fact from the switch between Python 2.7 and 3.7.

https://github.com/GitExl/WhackEd4/commits?after=25cd23dbc3968c4b1d385177884953bd5a18158e+104

When ac38c2e is built with Python 3.7 as intended, the ZDaemon config bug is present. However, when it's built with 2.7, the bug is absent. Also, I tried building with 3.7 using wxPython 4.0.6 and the 2.7-era wxPython 4.0.0b1 just to eliminate the possibility that wxWidgets/wxPython is the cause. No difference: 3.7 bugs out either way.

There is no specific commit where this starts. Rather, it's whether or not you build with Python 3.7. WhackEd4 is obviously too far along to consider a reversion, so something evidently needs to be brought up to Python 3.7 specs.

This Python 3.7 switch also seems to be responsible for a different issue #36.

GitExl commented 4 months ago

You're right, at some point Dict.keys() returns something that cannot be subscripted anymore. Wrapping it in list() works, thanks!