{"action":"closed","issue":{"url":"https://api.github.com/repos/pallets/flask/issues/1974","repository_url":"https://api.github.com/repos/pallets/flask","labels_url":"https://api.github.com/repos/pallets/flask/issues/1974/labels{/name}","comments_url":"https://api.github.com/repos/pallets/flask/issues/1974/comments","events_url":"https://api.github.com/repos/pallets/flask/issues/1974/events","html_url":"https://github.com/pallets/flask/issues/1974","id":169021824,"number":1974,"title":"POST to Flask has size limit, and provokes \"BrokenPipeError: [Errno 32] Broken pipe\" whenever no request.data is called","user":{"login":"Kieleth","id":2021949,"avatar_url":"https://avatars.githubusercontent.com/u/2021949?v=3","gravatar_id":"","url":"https://api.github.com/users/Kieleth","html_url":"https://github.com/Kieleth","followers_url":"https://api.github.com/users/Kieleth/followers","following_url":"https://api.github.com/users/Kieleth/following{/other_user}","gists_url":"https://api.github.com/users/Kieleth/gists{/gist_id}","starred_url":"https://api.github.com/users/Kieleth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kieleth/subscriptions","organizations_url":"https://api.github.com/users/Kieleth/orgs","repos_url":"https://api.github.com/users/Kieleth/repos","events_url":"https://api.github.com/users/Kieleth/events{/privacy}","received_events_url":"https://api.github.com/users/Kieleth/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-03T00:43:57Z","updated_at":"2016-09-06T19:55:36Z","closed_at":"2016-09-06T19:55:36Z","body":"Hi!\r\n``\r\nWe've experienced an interesting issue:\r\n\r\nFlask:\r\n```python\r\n#post_flask.py\r\nfrom flask import (Flask, request)\r\napp = Flask(__name__)\r\napp.config['MAX_CONTENT_LENGTH'] = 1600 * 1024 * 1024\r\n\r\n@app.route('/pepe_post', methods=['POST'])\r\ndef post_pepe():\r\n    print('Hey!!!')\r\n    if request.method == 'POST':\r\n        #print(len(request.data))  #<< Uncomment to fix!!!\r\n        return 'hoho'\r\n\r\nif __name__ == '__main__':\r\n    app.run(host='0.0.0.0', port=5555, debug=True)\r\n```\r\n\r\nClient:\r\n```python\r\n#do_post.py\r\nimport requests\r\n\r\ndef post(url, payload=None):\r\n    \"\"\" Handles POST http requests having an url and some optional payload \"\"\"\r\n    print(\"POST against url: '%s'\", url)\r\n    print(\"POST payload size: '%s'\", len(payload))\r\n    resp = requests.post(url, data=payload, headers={'content-type':'application/json'})\r\n    print(\"POST response: '%s'\", resp.text)\r\n    if resp.status_code != requests.codes.ok:\r\n        print('Service Response indicates error: %s/%s',\r\n                        resp.status_code, resp.content)\r\n        resp.raise_for_status()\r\n\r\nif __name__ == '__main__':\r\n    url = 'http://localhost:5555/pepe_post'\r\n    n = 1\r\n    while True:\r\n        print('post with payload of %s' % n)\r\n        payload = n * 1024 * 'a'   # << this breaks avobe 690K payloads\r\n        #payload = n * 1024 * 1024 * 'a'   # << this breaks inmediately\r\n        post(url, payload)\r\n        n += 1\r\n```\r\n\r\nMeaning, above ~690K posts, you get:\r\n\r\n```\r\npost with payload of 696\r\nPOST against url: '%s' http://localhost:5555/pepe_post\r\nPOST payload size: '%s' 712704\r\nTraceback (most recent call last):\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py\", line 559, in urlopen\r\n    body=body, headers=headers)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py\", line 353, in _make_request\r\n    conn.request(method, url, **httplib_request_kw)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 1137, in request\r\n    self._send_request(method, url, body, headers)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 1182, in _send_request\r\n    self.endheaders(body)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 1133, in endheaders\r\n    self._send_output(message_body)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 967, in _send_output\r\n    self.send(message_body)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 929, in send\r\n    self.sock.sendall(data)\r\nBrokenPipeError: [Errno 32] Broken pipe\r\n\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/adapters.py\", line 376, in send\r\n    timeout=timeout\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py\", line 609, in urlopen\r\n    _stacktrace=sys.exc_info()[2])\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/packages/urllib3/util/retry.py\", line 247, in increment\r\n    raise six.reraise(type(error), error, _stacktrace)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/packages/urllib3/packages/six.py\", line 309, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py\", line 559, in urlopen\r\n    body=body, headers=headers)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py\", line 353, in _make_request\r\n    conn.request(method, url, **httplib_request_kw)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 1137, in request\r\n    self._send_request(method, url, body, headers)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 1182, in _send_request\r\n    self.endheaders(body)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 1133, in endheaders\r\n    self._send_output(message_body)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 967, in _send_output\r\n    self.send(message_body)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/http/client.py\", line 929, in send\r\n    self.sock.sendall(data)\r\nrequests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"do_post.py\", line 21, in <module>\r\n    post(url, payload)\r\n  File \"do_post.py\", line 7, in post\r\n    resp = requests.post(url, data=payload, headers={'content-type':'application/json'})\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/api.py\", line 107, in post\r\n    return request('post', url, data=data, json=json, **kwargs)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/api.py\", line 53, in request\r\n    return session.request(method=method, url=url, **kwargs)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/sessions.py\", line 468, in request\r\n    resp = self.send(prep, **send_kwargs)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/sessions.py\", line 576, in send\r\n    r = adapter.send(request, **kwargs)\r\n  File \"/Users/lguzman/workspace/anaconda/anaconda3/envs/opportunity/lib/python3.4/site-packages/requests/adapters.py\", line 426, in send\r\n    raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))\r\n```\r\n\r\nCan someone give us some information about this? is this by design? bug?\r\n\r\nVersion:\r\nFlask==0.10.1\r\n\r\nThanks!"}}
{"actor":{"display_login":"untitaker"}}