{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/815","repository_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/815/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/815/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/815/events","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/815","id":369712160,"node_id":"MDU6SXNzdWUzNjk3MTIxNjA=","number":815,"title":"Send_File() throws an error when running with flask-socketio","user":{"login":"mntolia","id":10390224,"node_id":"MDQ6VXNlcjEwMzkwMjI0","avatar_url":"https://avatars1.githubusercontent.com/u/10390224?v=4","gravatar_id":"","url":"https://api.github.com/users/mntolia","html_url":"https://github.com/mntolia","followers_url":"https://api.github.com/users/mntolia/followers","following_url":"https://api.github.com/users/mntolia/following{/other_user}","gists_url":"https://api.github.com/users/mntolia/gists{/gist_id}","starred_url":"https://api.github.com/users/mntolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mntolia/subscriptions","organizations_url":"https://api.github.com/users/mntolia/orgs","repos_url":"https://api.github.com/users/mntolia/repos","events_url":"https://api.github.com/users/mntolia/events{/privacy}","received_events_url":"https://api.github.com/users/mntolia/received_events","type":"User","site_admin":false},"labels":[{"id":79522651,"node_id":"MDU6TGFiZWw3OTUyMjY1MQ==","url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-12T21:12:29Z","updated_at":"2018-10-15T19:07:11Z","closed_at":null,"author_association":"NONE","body":"Hi Miguel,\r\n\r\nYour library has been working great so far. \r\nWhen I run a send_file function in flask it throws this error:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/maxwell/Desktop/python/aqua/lib/python3.6/site-packages/eventlet/wsgi.py\", line 572, in handle_one_response\r\n    write(b''.join(towrite))\r\n  File \"/home/maxwell/Desktop/python/aqua/lib/python3.6/site-packages/eventlet/wsgi.py\", line 519, in write\r\n    wfile.flush()\r\n  File \"/usr/lib/python3.6/socket.py\", line 604, in write\r\n    return self._sock.send(b)\r\n  File \"/home/maxwell/Desktop/python/aqua/lib/python3.6/site-packages/eventlet/greenio/base.py\", line 395, in send\r\n    return self._send_loop(self.fd.send, data, flags)\r\n  File \"/home/maxwell/Desktop/python/aqua/lib/python3.6/site-packages/eventlet/greenio/base.py\", line 382, in _send_loop\r\n    return send_method(data, *args)\r\nBrokenPipeError: [Errno 32] Broken pipe\r\n\r\n```\r\nI am not sure if this error is because of socketio or something else.\r\n\r\nWhen I run the app with the normal `app.run()` the `send_file()` works perfectly. But only with socketio.run() this issue occurs.\r\n\r\nThank you for creating this library!"},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/comments/429976525","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/815#issuecomment-429976525","issue_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/815","id":429976525,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTk3NjUyNQ==","user":{"login":"mntolia","id":10390224,"node_id":"MDQ6VXNlcjEwMzkwMjI0","avatar_url":"https://avatars1.githubusercontent.com/u/10390224?v=4","gravatar_id":"","url":"https://api.github.com/users/mntolia","html_url":"https://github.com/mntolia","followers_url":"https://api.github.com/users/mntolia/followers","following_url":"https://api.github.com/users/mntolia/following{/other_user}","gists_url":"https://api.github.com/users/mntolia/gists{/gist_id}","starred_url":"https://api.github.com/users/mntolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mntolia/subscriptions","organizations_url":"https://api.github.com/users/mntolia/orgs","repos_url":"https://api.github.com/users/mntolia/repos","events_url":"https://api.github.com/users/mntolia/events{/privacy}","received_events_url":"https://api.github.com/users/mntolia/received_events","type":"User","site_admin":false},"created_at":"2018-10-15T19:07:11Z","updated_at":"2018-10-15T19:07:11Z","author_association":"NONE","body":"This view makes the call:\r\n`@bp.route('/<farm_id>/<device_id>/update', methods = ['GET'])\r\ndef version_checker(farm_id, device_id):\r\n    try:\r\n        device = DeviceList.query.filter(and_(DeviceList.farm_id == farm_id, DeviceList.mqtt_id == device_id)).first()\r\n        if device is not None:\r\n            print(request.headers)\r\n            if request.headers['X-Esp8266-Version'] < device.version_number:\r\n                response = make_response(send_file(\r\n                    'arduino.bin', \r\n                    mimetype='application/octet-stream',\r\n                    as_attachment=True\r\n                    ))\r\n                response.headers['x-MD5'] = md5('arduino.bin')\r\n                print(response.headers)\r\n                return response\r\n            else:\r\n                return \"304: Not Modified\", 304\r\n        else:\r\n            return   \"404: Not Found\", 404\r\n    except Exception as e:\r\n        print(e)\r\n        return \"502 Bad Gateway\", 406`"}}
{"actor":{"display_login":"mntolia"}}