RIDE icon indicating copy to clipboard operation
RIDE copied to clipboard

wxPython 4.2.0 support

Open JFoederer opened this issue 3 years ago • 1 comments

RIDE has a dependency with wxpython and there are some compatibility issues when running on python 10.

When using python 10 on Windows, wxpython versions older than 4.2 do not install. Older versions of wxpython on Linux show similar compatibility issues: TypeError: could not convert 'SourceEditor' to 'Dialog'.

Observed on:

  • Windows 11 | Python 3.10 | wxpython 4.2.0
  • Ubuntu 22 | Python 3.10 | wxpython 4.0.7 (after some code fixes)
  • Fedora 36 | Python 3.10 | wxpython 4.2.0 (local build)

Not observed on:

  • Windows 10 | Python 3.9 | wxpython 4.1.1
  • Fedora 36 | Python 3.10 | wxpython 4.0.7 (stock install)

This traceback is from Windows 11 | wxpython 4.2.0, Python 3.10.6:

Traceback (most recent call last):
  File "..Python310\lib\site-packages\robotide\application\application.py", line 77, in OnInit
    self._plugin_loader.enable_plugins()
  File "..Python310\lib\site-packages\robotide\application\pluginloader.py", line 36, in enable_plugins
    p.enable_on_startup()
  File "..Python310\lib\site-packages\robotide\application\pluginconnector.py", line 52, in enable_on_startup
    self.enable()
  File "..Python310\lib\site-packages\robotide\application\pluginconnector.py", line 57, in enable
    self._plugin.enable()
  File "..Python310\lib\site-packages\robotide\editor\texteditor.py", line 69, in enable
    if self._editor.is_focused():
  File "..Python310\lib\site-packages\robotide\editor\texteditor.py", line 56, in _editor
    self._editor_component = SourceEditor(self.notebook,
  File "..Python310\lib\site-packages\robotide\editor\texteditor.py", line 367, in __init__
    self._create_ui(title)
  File "..Python310\lib\site-packages\robotide\editor\texteditor.py", line 397, in _create_ui
    self._parent.add_tab(self, title, allow_closing=False)
  File "..Python310\lib\site-packages\robotide\ui\notebook.py", line 54, in add_tab
    self.AddPage(tab, title.strip())
  File "..Python310\lib\site-packages\wx\lib\agw\aui\auibook.py", line 3575, in AddPage
    return self.InsertPage(self.GetPageCount(), page, caption, select, bitmap, disabled_bitmap, control, tooltip)
  File "..Python310\lib\site-packages\wx\lib\agw\aui\auibook.py", line 3648, in InsertPage
    active_tabctrl.DoShowHide()
  File "..Python310\lib\site-packages\wx\lib\agw\aui\auibook.py", line 1921, in DoShowHide
    page.window.Show(False)
TypeError: could not convert 'SourceEditor' to 'Dialog'
OnInit returned false, exiting...

This is the output in Fedora 36, wxPython 4.2.0, Python 3.10.6:

Traceback (most recent call last):
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/application/application.py", line 77, in OnInit
    self._plugin_loader.enable_plugins()
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/application/pluginloader.py", line 36, in enable_plugins
    p.enable_on_startup()
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/application/pluginconnector.py", line 52, in enable_on_startup
    self.enable()
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/application/pluginconnector.py", line 57, in enable
    self._plugin.enable()
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/editor/texteditor.py", line 69, in enable
    if self._editor.is_focused():
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/editor/texteditor.py", line 56, in _editor
    self._editor_component = SourceEditor(self.notebook,
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/editor/texteditor.py", line 367, in __init__
    self._create_ui(title)
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/editor/texteditor.py", line 397, in _create_ui
    self._parent.add_tab(self, title, allow_closing=False)
  File "/home2/helio/venv/lib64/python3.10/site-packages/robotide/ui/notebook.py", line 54, in add_tab
    self.AddPage(tab, title.strip())
  File "/home2/helio/venv/lib64/python3.10/site-packages/wx/lib/agw/aui/auibook.py", line 3575, in AddPage
    return self.InsertPage(self.GetPageCount(), page, caption, select, bitmap, disabled_bitmap, control, tooltip)
  File "/home2/helio/venv/lib64/python3.10/site-packages/wx/lib/agw/aui/auibook.py", line 3648, in InsertPage
    active_tabctrl.DoShowHide()
  File "/home2/helio/venv/lib64/python3.10/site-packages/wx/lib/agw/aui/auibook.py", line 1921, in DoShowHide
    page.window.Show(False)
TypeError: could not convert 'SourceEditor' to 'Dialog'

Technical note, multi-class dependencies:

class SourceEditor(wx.Panel, RIDEDialog):  # (...) with superclass init:
    wx.Panel.__init__(self, parent)
    self.dlg = RIDEDialog()
class RIDEDialog(wx.Dialog):  # (...) with superclass init:
    wx.Dialog.__init__(self, parent=parent, title=title, size=size, style=style)

JFoederer avatar Aug 10 '22 09:08 JFoederer

@JFoederer I have cleaned up the code, and RIDE now starts fine in Ubuntu 22, Python 3.10 and wxPython 4.2.0. But unfortunately, the Grid Editor is broken (because of Settings' tooltips). If you want to experiment on Windows, please install with:

pip install -U https://github.com/HelioGuilherme66/RIDE/archive/refs/heads/miscellaneous.zip

HelioGuilherme66 avatar Aug 11 '22 10:08 HelioGuilherme66

Fixed by #2475

HelioGuilherme66 avatar Aug 20 '22 01:08 HelioGuilherme66

installed robotframework ride ,but the ride is not opening , getting as below error: TypeError: could not convert 'Tree' to 'Panel' OnInit returned false, exiting... Exception ignored in atexit callback: <built-in function _wxPyCleanup> wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at ../src/common/wincmn.cpp(477) in ~wxWindowBase(): any pushed event handlers must have been removed

Rohitride avatar Jun 30 '23 07:06 Rohitride

@Rohitride Please try to use other way to get support. Go to Slack or Forum from the links in README.

HelioGuilherme66 avatar Jun 30 '23 08:06 HelioGuilherme66