Pyfa icon indicating copy to clipboard operation
Pyfa copied to clipboard

Debugging with PyCharm is broken

Open DarkFenX opened this issue 5 years ago • 2 comments

At least on linux, for quite some time.

pyfa v2.14.2
EVE Data Version: 1604553 (2019-11-12 15:15:35)

OS version: Linux-5.2.0-3-amd64-x86_64-with-debian-bullseye-sid
Python version: 3.7.5 (default, Oct 27 2019, 15:43:29) 
[GCC 9.2.1 20191022]
wxPython version: 4.0.7 (wxWidgets 3.0.4)
SQLAlchemy version: 1.3.10
Logbook version: 1.4.3
Requests version: 2.21.0
Dateutil version: 2.7.3

####################

Traceback (most recent call last):
  File "/mnt/fast/dfx_space/software/pycharm/helpers/pydev/pydevd.py", line 2073, in <module>
    main()
  File "/mnt/fast/dfx_space/software/pycharm/helpers/pydev/pydevd.py", line 2067, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/mnt/fast/dfx_space/software/pycharm/helpers/pydev/pydevd.py", line 1418, in run
    return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
  File "/mnt/fast/dfx_space/software/pycharm/helpers/pydev/pydevd.py", line 1425, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/mnt/fast/dfx_space/software/pycharm/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/dfx/Workspace/eve/pyfa/pyfa.py", line 143, in <module>
    mf = MainFrame(options.title)
  File "/home/dfx/Workspace/eve/pyfa/gui/mainFrame.py", line 165, in __init__
    self.additionsPane = AdditionsPane(self.fitting_additions_split, self)
  File "/home/dfx/Workspace/eve/pyfa/gui/additionsPane.py", line 65, in __init__
    self.notebook.AddPage(self.drone, "Drones", image=droneImg, closeable=False)
  File "/home/dfx/Workspace/eve/pyfa/gui/chrome_tabs.py", line 230, in AddPage
    self.tabs_container.AddTab(title, image, closeable)
  File "/home/dfx/Workspace/eve/pyfa/gui/chrome_tabs.py", line 1251, in AddTab
    tab_renderer = _TabRenderer((200, self.height), title, img, closeable)
  File "/home/dfx/Workspace/eve/pyfa/gui/chrome_tabs.py", line 384, in __init__
    self.InitTab()
  File "/home/dfx/Workspace/eve/pyfa/gui/chrome_tabs.py", line 462, in InitTab
    self.InitColors()
  File "/home/dfx/Workspace/eve/pyfa/gui/chrome_tabs.py", line 546, in InitColors
    self.inactive_color = color_utils.GetSuitable(self.tab_color, 0.25)
  File "/home/dfx/Workspace/eve/pyfa/gui/utils/color.py", line 55, in GetSuitable
    return Darken(color, factor)
  File "/home/dfx/Workspace/eve/pyfa/gui/utils/color.py", line 33, in Darken
    return wx.Colour(r, g, b, a)
TypeError: Colour(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 1 has unexpected type 'float'
  overload 3: argument 1 has unexpected type 'float'
  overload 4: argument 1 has unexpected type 'float'

We indeed pass 3 floats and 1 int to wx.Colour, but it worked some time ago. However, it worked some time ago. It works now if I just launch pyfa from console or via non-debugging execution from pycharm. wx packages are used from the same location, I double-checked that - /usr/lib/python3/dist-packages/wx/__init__.py in my case. Yet, it is broken somehow.

Screenshot of debugging run configuration:

image

I am using system interpreter in both cases (debug run and run from console), the same version, no overrides on pycharm side.

Have to mention that wxpython docs do not mention floats as possible argument type for wx.Colour.

DarkFenX avatar Nov 16 '19 16:11 DarkFenX

Filed an upstream issue to find out what's the root cause: https://github.com/wxWidgets/Phoenix/issues/1442

DarkFenX avatar Nov 17 '19 00:11 DarkFenX

@DarkFenX think this is related to https://github.com/pyfa-org/Pyfa/issues/2391? I stumbled upon the upstream thread when investigating the Pyfa crashes on Arch Linux/Python 3.10 and the root cause seems the same.

njfox avatar Jan 04 '22 14:01 njfox