Skip to content

Detect serial ports fails on OSX #22

@benediktarnold

Description

@benediktarnold

Hi!
I installed the device manager on OSX (python 3.12) and I'm able to launch it. If I try to detect the serial ports, I get the following error:

2024-04-08 17:24:34,959 ERROR root Was not able to detect serial ports.
Traceback (most recent call last):
  File "/usr/local/Caskroom/miniconda/base/envs/eltako/lib/python3.12/site-packages/eo_man/view/serial_communication_bar.py", line 206, in detect_serial_ports
    self.main.config(cursor="watch")    #set cursor for waiting
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Caskroom/miniconda/base/envs/eltako/lib/python3.12/tkinter/__init__.py", line 1721, in configure
    return self._configure('configure', cnf, kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Caskroom/miniconda/base/envs/eltako/lib/python3.12/tkinter/__init__.py", line 1711, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
RuntimeError: main thread is not in main loop

I'm no python expert but from a quick research:
It seems that detect_serial_ports_command starts a new thread and this thread calls functions on the GUI. With TK this seems to be forbidden.

I'll try to debug more into it and open a PR if I'm successful finding a solution ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions