Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove leaky lru_cache #2277

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,4 @@ Contributors (chronological)
- Aditya Tewary `@aditkumar72 <https://github.com/aditkumar72>`_
- Sebastien Lovergne `@TheBigRoomXXL <https://github.com/TheBigRoomXXL>`_
- Peter C `@somethingnew2-0 <https://github.com/somethingnew2-0>`_
- Marcel Jackwerth `@mrcljx` <https://github.com/mrcljx>`_
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
---------

3.21.3 (unreleased)
*******************

Bug fixes:

- Fix memory leak that prevented schema instances from getting GC'd (:pr:`2277`).
Thanks :user:`mrcljx` for the PR.

3.21.2 (2024-05-01)
*******************

Expand Down
2 changes: 0 additions & 2 deletions src/marshmallow/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from abc import ABCMeta
from collections import OrderedDict, defaultdict
from collections.abc import Mapping
from functools import lru_cache

from marshmallow import base, class_registry, types
from marshmallow import fields as ma_fields
Expand Down Expand Up @@ -1056,7 +1055,6 @@ def _bind_field(self, field_name: str, field_obj: ma_fields.Field) -> None:
raise error
self.on_bind_field(field_name, field_obj)

@lru_cache(maxsize=8) # noqa (https://github.com/PyCQA/flake8-bugbear/issues/310)
def _has_processors(self, tag) -> bool:
return bool(self._hooks[(tag, True)] or self._hooks[(tag, False)])

Expand Down