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
When I upload multipart-encoded file larger than 2GB in python2 environment, the body will be truncated. Server side can not read data completely. But the content-length value in header is expected. At client side, it do not send all data.
After tracing of function calls, it is caused by python2 socket library bug. Requests will use socket.sendall() to send body, but it use int type to keep bytes need be sent and has sent: python2-socket-lib. I also create a issue to report this bug to python team.
Rather than waiting python team fix it, I thought Requests can fix quickly. After search it has also been reported many times.
Requests lib can split encoded string body into many segments each one smaller than 2GB, and send segments one by one. Or wrapping string body as as file-like object is also works, like this:
The text was updated successfully, but these errors were encountered:
kmiku7
changed the title
Upload file larger than 2GB will be truncated.
The reason that ppload file larger than 2GB will be truncated.
Mar 18, 2019
kmiku7
changed the title
The reason that ppload file larger than 2GB will be truncated.
The reason that uploading file larger than 2GB will be truncated.
Mar 18, 2019
When I upload multipart-encoded file larger than 2GB in python2 environment, the body will be truncated. Server side can not read data completely. But the content-length value in header is expected. At client side, it do not send all data.
After tracing of function calls, it is caused by python2 socket library bug. Requests will use socket.sendall() to send body, but it use int type to keep bytes need be sent and has sent: python2-socket-lib. I also create a issue to report this bug to python team.
Rather than waiting python team fix it, I thought Requests can fix quickly. After search it has also been reported many times.
Requests lib can split encoded string body into many segments each one smaller than 2GB, and send segments one by one. Or wrapping string body as as file-like object is also works, like this:
The text was updated successfully, but these errors were encountered: