{"action":"created","issue":{"url":"https://api.github.com/repos/pallets/flask/issues/2766","repository_url":"https://api.github.com/repos/pallets/flask","labels_url":"https://api.github.com/repos/pallets/flask/issues/2766/labels{/name}","comments_url":"https://api.github.com/repos/pallets/flask/issues/2766/comments","events_url":"https://api.github.com/repos/pallets/flask/issues/2766/events","html_url":"https://github.com/pallets/flask/issues/2766","id":321319587,"number":2766,"title":"send_file: latin-1 encoding not compatible with gunicorn","user":{"login":"jrast","id":146369,"avatar_url":"https://avatars3.githubusercontent.com/u/146369?v=4","gravatar_id":"","url":"https://api.github.com/users/jrast","html_url":"https://github.com/jrast","followers_url":"https://api.github.com/users/jrast/followers","following_url":"https://api.github.com/users/jrast/following{/other_user}","gists_url":"https://api.github.com/users/jrast/gists{/gist_id}","starred_url":"https://api.github.com/users/jrast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrast/subscriptions","organizations_url":"https://api.github.com/users/jrast/orgs","repos_url":"https://api.github.com/users/jrast/repos","events_url":"https://api.github.com/users/jrast/events{/privacy}","received_events_url":"https://api.github.com/users/jrast/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-05-08T19:37:23Z","updated_at":"2018-05-24T14:30:27Z","closed_at":null,"author_association":"NONE","body":"With the latest release (flask 1.0.0), unicode attachement filenames are allowed by flask.\r\nI was waiting for this change and it seems to work great using the builtin dev server. However, gunicorn on the production server does not support `latin-1` encoding for the headers and only supports `ascii`.\r\n\r\nOriginaly flask also opted for ASCII encoding, however commit 336d6a48e0104b53302fd8377dd399af43607cf9 changed this and since then `latin-1` is used.\r\n\r\nWhat was the rational to switch to `latin-1`? I know, officially it's allowed, however gunicorn decided to only support ASCII: (see related issue)\r\n\r\n > it's well documented around the web that HTTP headers should be ASCII\r\n\r\nIs there a change that flask also switches back to ASCII?\r\n\r\nRelated Issues: \r\nhttps://github.com/pallets/flask/pull/2223\r\nhttps://github.com/benoitc/gunicorn/issues/1353\r\n"},"comment":{"url":"https://api.github.com/repos/pallets/flask/issues/comments/391736114","html_url":"https://github.com/pallets/flask/issues/2766#issuecomment-391736114","issue_url":"https://api.github.com/repos/pallets/flask/issues/2766","id":391736114,"user":{"login":"davidism","id":1242887,"avatar_url":"https://avatars1.githubusercontent.com/u/1242887?v=4","gravatar_id":"","url":"https://api.github.com/users/davidism","html_url":"https://github.com/davidism","followers_url":"https://api.github.com/users/davidism/followers","following_url":"https://api.github.com/users/davidism/following{/other_user}","gists_url":"https://api.github.com/users/davidism/gists{/gist_id}","starred_url":"https://api.github.com/users/davidism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidism/subscriptions","organizations_url":"https://api.github.com/users/davidism/orgs","repos_url":"https://api.github.com/users/davidism/repos","events_url":"https://api.github.com/users/davidism/events{/privacy}","received_events_url":"https://api.github.com/users/davidism/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T14:30:27Z","updated_at":"2018-05-24T14:30:27Z","author_association":"MEMBER","body":"I ran the following with Gunicorn and it worked:\r\n\r\n```python\r\nfrom flask import Flask, send_file\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route('/')\r\ndef index():\r\n    return send_file('example.py', as_attachment=True, attachment_filename='pingüino.txt')\r\n```\r\n\r\n```\r\ngunicorn example:app\r\n```"}}
{"actor":{"display_login":"davidism"}}