Rfswarm tkinter.tclerror

Hey Dave,

Thank you for helping out by the way.

I am running a new mac book pro with Apple M1 MAX chip

I’ve performed a reinstall to be certain, but do see the following
Warning: python-tk@3.13 3.13.3 is already installed and up-to-date.

I also ran the TK_SILENCE command
When running python3 -m tkinter I get the pop up appear, no version number just the close and click me button.
I believe this works because of the code changes undertaken.

Cheers
Stu

Hey Stuart,

Unfortunatly I’m a bit stuck on what to suggest, and I don’t have an M1 based mac to test your configuration with.

I know the github runners use homebrew to install python and are also M1 based machines and the GUI loads there for our regression tests.

It seems to be related to the tkinter setup but without knowing what Tk version you have it makes it a bit hard to diagnose, If you can figure out the Tk version then I might be able to reproduce it on another platform?

The no version number is making it hard, because of this I’m suspecting maybe you have tk version 9.x.x ? which I know we never tested

This thread mentions a few ways to get the tkinter version from python, can you try these and see if you can find the version?

https://stackoverflow.com/questions/35999344/how-to-determine-what-version-of-python3-tkinter-is-installed-on-my-linux-machin

Another option would be try uninstalling tkinter and instead of installing latest install a version that is 8.6.x which is what I’m fairly sure will work.

Dave.

homebrew python 3.13 (.2) ships with 9.0.1 tk..

1 Like

Hey Stuart,

Maybe I reproduced the issue, is this like what you’re getting?:

For this I’m running Python 3.13.3 with tkinter 9.0.1

Here I’m actually using WSL Ubuntu on a windows 11 VM, cause I was about to throw away this VM so decided to test it out here before I threw it away.

Well good news, if this is the issue I know how to fix it:

There are 3 lines in rfswarm.py that contain .trace("w", this part of the line just needs to be replaced with .trace_add("write" and rfswarm will function normally (this was the fix that @ArekKuczynski identified above.

@ArekKuczynski had already raised issue 364 for this, so I’ve moved this issue up for the v1.5.1 bug fix release

Let me know if this is different/same as your issue, so I know if I need to keep investigating.

Dave.

Managed to locate 2 locations on lines 7887 & 9022.

This still returns the same as with the previous changes still present.

Attempted to replace the rfswarm.py out of git hub with what I have now.

Could still only locate 2 places, I’m not discounting user error here :slight_smile: and with just the trace_add(“write” changes I ended up with the old errors appearing again.

I tried to pinpoint to this too be linking to a bug where this same thing was happening that linked to a changelog mentioning this change but hey, i wasn’t clear enough :wink:

The other one is line 7500 (well it’s also in the commented out line below that as well for a 4th line)

Oddly lines 7887 and 9022 were 7886 and 9021 for me, not sure what cause the 1 line offset?

Dave.

Found it.. but still the same issue…
I fear I may have to wait t do the POC on this one

Hi Stuart,

Maybe you can try the dev build mentioned in Issue #366 as it worked for Rüdiger, who is also on MacOS 15.5 and Hombrew Python 3.13. That build should be accessible for a couple more days.

Dave.

Hi Dave,

I’m cursed :smile:

So attempted to install the whl files and was back to my original issue.

So uninstalled everything and then reinstalled fresh, then reinstalled the V1.5.1 whl files and again the same issue.

Robot Framework Swarm: Manager
Version 1.5.1
Configuration File: /PATH/venv/lib/python3.10/site-packages/rfswarm_manager/RFSwarmManager.ini
Traceback (most recent call last):
File “/PATH/venv/bin/rfswarm”, line 5, in
from rfswarm_manager.rfswarm import RFSwarm
File “/PATH/venv/lib/python3.10/site-packages/rfswarm_manager/rfswarm.py”, line 10708, in
core = RFSwarmCore()
File “/PATH/venv/lib/python3.10/site-packages/rfswarm_manager/rfswarm.py”, line 2741, in init
base.gui = RFSwarmGUI()
File “/PATH/venv/lib/python3.10/site-packages/rfswarm_manager/rfswarm.py”, line 4810, in init
self.set_app_icon()
File “/PATH/venv/lib/python3.10/site-packages/rfswarm_manager/rfswarm.py”, line 4849, in set_app_icon
self.icon = tk.PhotoImage(file=icon_file)
File “/PATH/.pyenv/versions/3.10.14/lib/python3.10/tkinter/init.py”, line 4103, in init
Image.init(self, ‘photo’, name, cnf, master, **kw)
File “/PATH/.pyenv/versions/3.10.14/lib/python3.10/tkinter/init.py”, line 4048, in init
self.tk.call((‘image’, ‘create’, imgtype, name,) + options)
_tkinter.TclError: couldn’t recognize data in image file “/PATH/venv/lib/python3.10/site-packages/rfswarm_manager/icons/rfswarm-manager-128.png”

Hi Stuart,

So I just realised I think you have Tk 9.x with Python 3.10.14, is there a reason for this combination?

Tk 9.x is very new and from researching these issues I’ve seen people using it with python 3.12+

So I think you might be encountering a comparability issue between Tk 9.x andPython 3.10.x (I could also be wrong here?)

If you want Tk 9.x it might be best to update to Python 3.13, if you want to stay with Python 3.10.x it might be better to go with Tk 8.6.x.

All testing of RFSwarm till now has been with python versions 3.9 - 3.13 and tk 8.6 (cause that’s what the github runners provide), so that would be your best option if you just want to get RFSwarm working right now.

Meanwhile I’m still trying to figure out how to coax the github runners to use Tk 9.x but haven’t succeeded yet, I’m aiming to have that working and have Python 3.13 with Tk 9.x tested for Release 1.5.1

Dave.

@damies13
Swapped Python versions.. I don’t have a dependancy so no problem rolling forward.

I’ve managed to get 1 step forward I believe, using the V1.5.1 build.

When I run rfswarm from the terminal I now see the following

Robot Framework Swarm: Manager
Version 1.5.1
Configuration File: /PATHREMOVED/venv/lib/python3.13/site-packages/rfswarm_manager/RFSwarmManager.ini
zsh: segmentation fault rfswarm

Then I get a crash report.. Python Quit unexpectedley


Translated Report (Full Report Below)

Process: python3.13 [94153]
Path: /Users/USER/*/python
Identifier: python3.13
Version: ???
Code Type: ARM-64 (Native)
Parent Process: zsh [30260]
Responsible: idea [29988]
User ID: 502

Date/Time: 2025-06-09 09:55:03.9901 +0100
OS Version: macOS 15.5 (24F74)
Report Version: 12
Anonymous UUID: BDB2F659-71A1-BD38-6170-077C6D4DC026

Sleep/Wake UUID: 142CFD81-712E-427A-988B-FC5DCB1433F2

Time Awake Since Boot: 8300 seconds
Time Since Wake: 1801 seconds

System Integrity Protection: enabled

Crashed Thread: 8

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000050
Exception Codes: 0x0000000000000001, 0x0000000000000050

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [94153]

VM Region Info: 0x50 is not in any region. Bytes before following region: 4372053936
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
—>
__TEXT 104984000-104988000 [ 16K] r-x/r-x SM=COW /Users/USER/*/python3.13

Thread 8 Crashed:
0 libtcl9tk9.0.dylib 0x1060d9e2c Tk_GetImageModelData + 24
1 libtcl9tk9.0.dylib 0x1060e417c Tk_FindPhoto + 20
2 _tkagg.cpython-313-darwin.so 0x1065d547c mpl_tk_blit(pybind11::object, char const*, pybind11::array_t<unsigned char, 16>, int, std::__1::tuple<int, int, int, int>, std::__1::tuple<int, int, int, int>) + 100
3 _tkagg.cpython-313-darwin.so 0x1065de230 void pybind11::detail::argument_loader<pybind11::object, char const*, pybind11::array_t<unsigned char, 16>, int, std::__1::tuple<int, int, int, int>, std::__1::tuple<int, int, int, int>>::call_impl<void, void (&)(pybind11::object, char const, pybind11::array_t<unsigned char, 16>, int, std::__1::tuple<int, int, int, int>, std::__1::tuple<int, int, int, int>), 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, pybind11::detail::void_type>(void (&)(pybind11::object, char const, pybind11::array_t<unsigned char, 16>, int, std::__1::tuple<int, int, int, int>, std::__1::tuple<int, int, int, int>), std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul>, pybind11::detail::void_type&&) && + 104
4 _tkagg.cpython-313-darwin.so 0x1065ddf28 void pybind11::cpp_function::initialize<void (&)(pybind11::object, char const, pybind11::array_t<unsigned char, 16>, int, std::__1::tuple<int, int, int, int>, std::__1::tuple<int, int, int, int>), void, pybind11::object, char const*, pybind11::array_t<unsigned char, 16>, int, std::__1::tuple<int, int, int, int>, std::__1::tuple<int, int, int, int>, pybind11::name, pybind11::scope, pybind11::sibling, pybind11::arg, pybind11::arg, pybind11::arg, pybind11::arg, pybind11::arg, pybind11::arg>(void (&)(pybind11::object, char const, pybind11::array_t<unsigned char, 16>, int, std::__1::tuple<int, int, int, int>, std::__1::tuple<int, int, int, int>), void ()(pybind11::object, char const, pybind11::array_t<unsigned char, 16>, int, std::__1::tuple<int, int, int, int>, std::__1::tuple<int, int, int, int>), pybind11::name const&, pybind11::scope const&, pybind11::sibling const&, pybind11::arg const&, pybind11::arg const&, pybind11::arg const&, pybind11::arg const&, pybind11::arg const&, pybind11::arg const&)::‘lambda’(pybind11::detail::function_call&)::__invoke(pybind11::detail::function_call&) + 836
5 _tkagg.cpython-313-darwin.so 0x1065d95f4 pybind11::cpp_function::dispatcher(_object*, _object*, _object*) + 4732
6 libpython3.13.dylib 0x1050cb908 cfunction_call + 92
7 libpython3.13.dylib 0x105079310 _PyObject_MakeTpCall + 300
8 libpython3.13.dylib 0x1051a4e1c _PyEval_EvalFrameDefault + 24540
9 _tkinter.cpython-313-darwin.so 0x10590af24 PythonCmd + 248
10 libtcl9.0.dylib 0x1063c6aa8 TclNRRunCallbacks + 72
11 _tkinter.cpython-313-darwin.so 0x105905dbc Tkapp_Call + 488
12 libpython3.13.dylib 0x105084cb4 method_vectorcall_VARARGS + 144
13 libpython3.13.dylib 0x105079a24 PyObject_Vectorcall + 88
14 libpython3.13.dylib 0x1051a4e1c _PyEval_EvalFrameDefault + 24540
15 libpython3.13.dylib 0x10507c0ec method_vectorcall + 316
16 libpython3.13.dylib 0x1051a51ac _PyEval_EvalFrameDefault + 25452
17 libpython3.13.dylib 0x10507c0ec method_vectorcall + 316
18 libpython3.13.dylib 0x1052779a0 thread_run + 128
19 libpython3.13.dylib 0x10521834c pythread_wrapper + 28
20 libsystem_pthread.dylib 0x19798ec0c _pthread_start + 136
21 libsystem_pthread.dylib 0x197989b80 thread_start + 8

Hi Stuart,

This crash dump confirms you have tkinter 9.0.x, but I can’t tell if that’s 9.0.0 or 9.0.1

It also shows that python is calling the tk functions and then tk is crashing for some reason, so it seems like your tkinter install has a problem, maybe it’s damaged or has a bug?

Now that you’ve updated python can you try python3 -m tkinter again and see if you can confirm your tkinter version?

Perhaps you need to uninstall and reinstall tkinter?

Dave.

Ah you were spot on, thank you Dave.
It has worked and I have 9.0.1

Attempted a reinstall to no avail