Skip to content

Use of functools.lru_cache or functools.cache on methods can lead to memory leaks #312

Open
@wRAR

Description

@wRAR

ruff detects that @lru_cache used on GenericTranslator.css_to_xpath() and HTMLTranslator.css_to_xpath() (added in #109) is not a good idea: "the global cache will retain a reference to the instance, preventing it from being garbage collected", we need to fix or ignore this. I think there are some singletons of these types and maybe we don't use other instances of them but this needs investigating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions