Skip to content

[BUG] Recursive MadHatter initialization #1071

@Pingdred

Description

@Pingdred

Describe the bug
Calling MadHatter in the activated override of a plugin causes an infinite loop of MadHatter initialization.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new plugin.
  2. Create a Python file and write the following code:
from cat.mad_hatter.decorators import plugin
from cat.mad_hatter.mad_hatter import MadHatter

@plugin
def activated(plugin):
    MadHatter()

Expected behavior
Since MadHatter is a singleton, it should be accessible from anywhere in the code without triggering reinitialization.

Additional context
This bug was introduced in CheshireCat version 1.8.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmad hatterRelated to the plugin system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions