From 250109e3f0e5cc751001e022b04b1a350efd0ba4 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Fri, 25 Oct 2024 11:01:51 -0500 Subject: [PATCH] fix: use len instead of sys.gesizeof method to return the size --- openedx/core/djangoapps/content_libraries/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/content_libraries/api.py b/openedx/core/djangoapps/content_libraries/api.py index c2a0bcd99640..6c7189a1ac79 100644 --- a/openedx/core/djangoapps/content_libraries/api.py +++ b/openedx/core/djangoapps/content_libraries/api.py @@ -57,7 +57,7 @@ import hashlib import logging import mimetypes -import sys + import attr import requests @@ -1206,7 +1206,7 @@ def add_library_block_static_asset_file(usage_key, file_path, file_content, user return LibraryXBlockStaticFile( path=file_path, url=site_root_url + local_path, - size=sys.getsizeof(file_content), + size=len(file_content), )