You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I review those source code, find that the coerce_datafunction did't consider about the mmap.mmap object. Then the total_lenfunction work different from other io object (always return the origin size). Then the bytes_left_to_writefunction always return True, fall into the infinity loop.
In my opinion, judge the mmap.mmap object by isinstance(data, mmap.mmap) or hasattr(data, 'madvise'), or other method?
Now, I fix my code by manually wrapped with FileWrapper, as
MultipartEncoder can't handle mmap.mmap object correctly.
MultipartEncoder
can't handlemmap.mmap
object correctly. For example,it will fall into an infinity loop in
m.read()
.I review those source code, find that the
coerce_data
function did't consider about themmap.mmap
object. Then thetotal_len
function work different from other io object (always return the origin size). Then thebytes_left_to_write
function always returnTrue
, fall into the infinity loop.In my opinion, judge the
mmap.mmap
object byisinstance(data, mmap.mmap)
orhasattr(data, 'madvise')
, or other method?Now, I fix my code by manually wrapped with
FileWrapper
, asI have little experience to pull requests. Could someone fix it from this package?
The text was updated successfully, but these errors were encountered: