Skip to content

Commit

Permalink
convert to string
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Jul 6, 2024
1 parent 871d416 commit caea6e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ofscraper/utils/paths/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand All @@ -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")
Expand Down

0 comments on commit caea6e8

Please sign in to comment.