Skip to content

Commit a16a04b

Browse files
Dmitry V SelitskyDmitry V Selitsky
authored andcommitted
len(data) 'Each part of the body must have a known size.' fix
1 parent ec5521c commit a16a04b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/atom/http_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def add_body_part(self, data, mime_type, size=None):
115115
size: int Required if the data is a file like object. If the data is a
116116
string, the size is calculated so this parameter is ignored.
117117
"""
118-
if isinstance(data, str):
118+
if hasattr(data, '__len__'):
119119
size = len(data)
120120
if size is None:
121121
# TODO: support chunked transfer if some of the body is of unknown size.

0 commit comments

Comments
 (0)