Enhance super_len to count encoded bytes for str

This fixes issue #6586
This commit is contained in:
Bruce Adams
2023-11-28 13:17:49 -05:00
parent f6707042d8
commit 3fd309a5c1
+3
View File
@@ -134,6 +134,9 @@ def super_len(o):
total_length = None
current_position = 0
if isinstance(o, str):
o = o.encode("utf-8")
if hasattr(o, "__len__"):
total_length = len(o)