mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Enhance super_len to count encoded bytes for str
This fixes issue #6586
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user