Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Drop patch for reference cycles in Gzip (#17610)
Filip Owczarek4c3486ff418a
diff --git a/saleor/patch_gzip.py b/saleor/patch_gzip.pydeleted file mode 100644index 69fd007775..0000000000--- a/saleor/patch_gzip.py+++ /dev/null@@ -1,16 +0,0 @@-from gzip import _WriteBufferStream # type: ignore[attr-defined]---def __del_tmp__(self):- del self.gzip_file---def patch_gzip():- """Patch `__del__` in `_WriteBufferStream` from `gzip` to avoid memory leaks.-- Those changes will remove the circular references in `GzipFile`, allowing memory to be freed immediately,- without the need of a deep garbage collection cycle.- Cycle: `GzipFile._buffer` -> `BufferedWriter._raw` -> `_WriteBufferStream.gzip_file` -> `GzipFile`.- Issue: https://github.com/python/cpython/issues/129640- """- _WriteBufferStream.__del__ = __del_tmp__diff --git a/saleor/settings.py b/saleor/settings.pyindex 0e59dfa055..877a951c24 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -34,7 +34,6 @@ from .core.languages import LANGUAGES as CORE_LANGUAGESfrom .core.schedules import initiated_promotion_webhook_schedulefrom .graphql.executor import patch_executorfrom .graphql.promise import patch_promise-from .patch_gzip import patch_gzipfrom .patch_local import patch_localdjango_stubs_ext.monkeypatch()@@ -1068,10 +1067,6 @@ i18n_rules_override()# immediately, without the need of a deep garbage collection cycle.patch_promise()-# Patch `_WriteBufferStream` from `gizip` to remove all references that could result in reference cycles,-# allowing memory to be freed immediately, without the need of a deep garbage collection cycle.-patch_gzip()-# Patch `DatabaseClient`, `DatabaseCreation`, `DatabaseFeatures`, `DatabaseIntrospection`, `DatabaseOperations`,# `BaseDatabaseValidation` and `DatabaseErrorWrapper` to remove all references that could result in reference cycles,# allowing memory to be freed immediately, without the need of a deep garbage collection cycle.