From 0accb24bea18594b32835a611e16e638d1cbe605 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 d53ec0dfe64..14a65aad79d 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 @@ -1228,7 +1228,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), )