a while ago I tried adding a custom active tool in texture paint mode. I then got an error which I submitted as a bug. The bug was confirmed, but hasn't been worked on in the last few months. Then someone commented that the problem might be the circle select which I had in my script from the default code. While that would have made sense, removing it didn't resolve the error.
Now I'm wondering if I'm missing something else or if it's just a bug as I initially thought.
The scripts as well as the conversation can be found here: https://developer.blender.org/T63892