From caea6e87a8625fda6d130279435039a2749835cf Mon Sep 17 00:00:00 2001 From: datawhores Date: Fri, 5 Jul 2024 19:35:50 -0500 Subject: [PATCH] convert to string --- ofscraper/utils/paths/paths.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ofscraper/utils/paths/paths.py b/ofscraper/utils/paths/paths.py index 0b1d8229e..43ec20024 100644 --- a/ofscraper/utils/paths/paths.py +++ b/ofscraper/utils/paths/paths.py @@ -62,6 +62,7 @@ def temp_cleanup(): def truncate(path): path = pathlib.Path(os.path.normpath(path)) + return _windows_truncateHelper(path) if platform.system() == "Windows": return _windows_truncateHelper(path) elif platform.system() == "Linux": @@ -159,9 +160,11 @@ def get_string_byte_size_unix(text): The estimated byte size of the string. """ total_size = 0 + text=str(text) normal_char_size=constants.getattr("NORMAL_CHAR_SIZE_UNIX") special_char_size=constants.getattr("SPECIAL_CHAR_SIZE_UNIX") utf=constants.getattr("UTF") + if utf: return len(text.encode(utf)) for char in text: @@ -188,6 +191,7 @@ def get_string_byte_size_windows(text): The estimated byte size of the string. """ total_size = 0 + text=str(text) normal_char_size=constants.getattr("NORMAL_CHAR_SIZE_WINDOWS") special_char_size=constants.getattr("SPECIAL_CHAR_SIZE_WINDOWS") utf=constants.getattr("UTF")