{"issue":{"created_at":"2011-10-12T13:07:00Z","state":"open","updated_at":"2011-11-25T18:28:07Z","user":{"gravatar_id":"fb8ae27474b32ccb7acad52a622ca325","id":1122355,"url":"https://api.github.com/users/Schibum","login":"Schibum","avatar_url":"https://secure.gravatar.com/avatar/fb8ae27474b32ccb7acad52a622ca325?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":2,"body":"The following snipset demonstrates the problem:\r\n\r\nhttps://gist.github.com/1281146\r\n\r\nSubsequent calls to Object.send() fail if they are approx 20 seconds apart. The connection seems to be closed after some seconds of inactivity  by the server. While some other methods (those that use Connection.make_request()) automatically reconnect in such cases (IOError), send() and  write() do not.\r\n\r\nI'm not sure if this can be fixed somehow. I guess simply restarting the request is not possible as data sources cannot always be rewinded.","assignee":null,"number":50,"id":1887100,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Subsequent calls to send cause IOError ([Errno 32] Broken pipe)","closed_at":null,"html_url":"https://github.com/rackspace/python-cloudfiles/issues/50","url":"https://api.github.com/repos/rackspace/python-cloudfiles/issues/50","milestone":null},"action":"created","comment":{"created_at":"2011-11-25T18:28:07Z","updated_at":"2011-11-25T18:28:07Z","user":{"gravatar_id":"5245f5d14a5f42484740acd3b2e9d3c6","id":361492,"url":"https://api.github.com/users/michelts","login":"michelts","avatar_url":"https://secure.gravatar.com/avatar/5245f5d14a5f42484740acd3b2e9d3c6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I guess simply restarting the request is not possible as data sources cannot always be rewinded.\r\n\r\nI agree with you. This way, we need to recall send. It could be done on the application side reather than in the python-cloudfiles side but, as the other methods has a retry request method, it is pretty good to have it on send method too.\r\n\r\nWe could just call again the send from himself but the iterable was changed and we would get an IncompleteSend exception.\r\n\r\nTo avoid that, I copied the iterable using the [itertools.tee](http://docs.python.org/library/itertools.html#itertools.tee) utility. See the pull request #57.\r\n","id":2877022,"url":"https://api.github.com/repos/rackspace/python-cloudfiles/issues/comments/2877022"}}