Repository navigation
Conversation
Documentation build overview
428 files changed ·
|
|
@gpshead could you please review this ( I am a new contributor, trying to find best ways to help) ? |
|
@serhiy-storchaka , would you like to review this? |
ambv
left a comment
There was a problem hiding this comment.
Instead of wrapping req.data, can't we just record where the body starts and seek the original object back there before retrying? That solves the things I'm pointing out in the comments.
|
When you're done making the requested changes, leave the comment: |
Yup, sounds good. For the non-seekable body, we will not do a retry. We can retry the 401, so that sender and send with the fresh stream. |
Fix :mod:`urllib.request` HTTP authentication retries sending an empty POST body when :attr:`~urllib.request.Request.data` is a file-like object. The body is now rewound to the position it was in before the original request was sent; if it is not seekable, the retry is abandoned and the ``401`` response is returned to the caller instead.
8bc5f22 to
344f5cd
Compare
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @ambv: please review the changes made to this pull request. |
Fix long-standing bug where HTTP Basic/Digest auth retries send an empty POST body when
Request.datais a consumed file-like object (e.g.mmap.mmap, open file,BytesIO).Fixes gh-49288.