{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/3655","repository_url":"https://api.github.com/repos/kennethreitz/requests","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/3655/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/3655/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/3655/events","html_url":"https://github.com/kennethreitz/requests/pull/3655","id":186047502,"number":3655,"title":"Rewind readable body before POST redirect","user":{"login":"nateprewitt","id":5271761,"avatar_url":"https://avatars.githubusercontent.com/u/5271761?v=3","gravatar_id":"","url":"https://api.github.com/users/nateprewitt","html_url":"https://github.com/nateprewitt","followers_url":"https://api.github.com/users/nateprewitt/followers","following_url":"https://api.github.com/users/nateprewitt/following{/other_user}","gists_url":"https://api.github.com/users/nateprewitt/gists{/gist_id}","starred_url":"https://api.github.com/users/nateprewitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateprewitt/subscriptions","organizations_url":"https://api.github.com/users/nateprewitt/orgs","repos_url":"https://api.github.com/users/nateprewitt/repos","events_url":"https://api.github.com/users/nateprewitt/events{/privacy}","received_events_url":"https://api.github.com/users/nateprewitt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-29T00:18:10Z","updated_at":"2016-11-01T17:02:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kennethreitz/requests/pulls/3655","html_url":"https://github.com/kennethreitz/requests/pull/3655","diff_url":"https://github.com/kennethreitz/requests/pull/3655.diff","patch_url":"https://github.com/kennethreitz/requests/pull/3655.patch"},"body":"This addresses the issue (#3079) of Requests hanging when a POST with a file-like body encounters a temporary redirect. This currently has the unmerged tests from #3536, so I'll need to remove those if we reach a point where we're ready to merge this.\n\nThis approach has a couple of things that I'm not especially happy with but couldn't come up with a nicer alternative. I've added a few outstanding questions below.\n\n1.) I feel like `body_position` should probably be `_body_position`, but we need to use it in the `Session` module. Making it a private var would require an additional getter method for `PreparedRequest` to expose the data to `Session`, but I wanted to run that by before adding more  code. It just seems problematic to provide any encouragement to manually set `body_position` since it will lead to fairly unintuitive behaviour.\n\n2.) As I noted in the comment [here](https://github.com/nateprewitt/requests/commit/b84d71461e238b123a39ce91a48a99e3eb03717c#commitcomment-19619276), this still allows for the possibility that a request with a file-like object, that has tell but no seek, to hang. I feel like we should raise an `IOError` if we can't rewind, at least allowing the user to manually recreate the body and POST it to the new URL. Does that seem reasonable?\n"},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/257624852","html_url":"https://github.com/kennethreitz/requests/pull/3655#issuecomment-257624852","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/3655","id":257624852,"user":{"login":"nateprewitt","id":5271761,"avatar_url":"https://avatars.githubusercontent.com/u/5271761?v=3","gravatar_id":"","url":"https://api.github.com/users/nateprewitt","html_url":"https://github.com/nateprewitt","followers_url":"https://api.github.com/users/nateprewitt/followers","following_url":"https://api.github.com/users/nateprewitt/following{/other_user}","gists_url":"https://api.github.com/users/nateprewitt/gists{/gist_id}","starred_url":"https://api.github.com/users/nateprewitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateprewitt/subscriptions","organizations_url":"https://api.github.com/users/nateprewitt/orgs","repos_url":"https://api.github.com/users/nateprewitt/repos","events_url":"https://api.github.com/users/nateprewitt/events{/privacy}","received_events_url":"https://api.github.com/users/nateprewitt/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T17:02:52Z","updated_at":"2016-11-01T17:02:52Z","body":"Alright, ValueError removed, tuple properly instantiated, and comment added. I also squashed most of the commits down. There's an unnecessary space I need to pull from beneath the `_body_position` declaration but I'll do that when I remove bc199e7 before merging. That is unless we have another round :)"}}
{"actor":{"display_login":"nateprewitt"}}