{"action":"opened","issue":{"url":"https://api.github.com/repos/aws/aws-cli/issues/1124","labels_url":"https://api.github.com/repos/aws/aws-cli/issues/1124/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-cli/issues/1124/comments","events_url":"https://api.github.com/repos/aws/aws-cli/issues/1124/events","html_url":"https://github.com/aws/aws-cli/issues/1124","id":56508356,"number":1124,"title":"Can't escape characters in `content-disposition`","user":{"login":"kvz","id":26752,"avatar_url":"https://avatars.githubusercontent.com/u/26752?v=3","gravatar_id":"","url":"https://api.github.com/users/kvz","html_url":"https://github.com/kvz","followers_url":"https://api.github.com/users/kvz/followers","following_url":"https://api.github.com/users/kvz/following{/other_user}","gists_url":"https://api.github.com/users/kvz/gists{/gist_id}","starred_url":"https://api.github.com/users/kvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvz/subscriptions","organizations_url":"https://api.github.com/users/kvz/orgs","repos_url":"https://api.github.com/users/kvz/repos","events_url":"https://api.github.com/users/kvz/events{/privacy}","received_events_url":"https://api.github.com/users/kvz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-04T10:21:51Z","updated_at":"2015-02-04T10:21:51Z","closed_at":null,"body":"Hi,\r\n\r\nWe're running into some strange issues. Our commands are generated by a function that escapes characters that could have a special meaning in bash.\r\n\r\nFor the past 5 years this has been keeping us safe, and working fine, but after we recently switched to this official aws cli, we're running into problems.\r\n\r\nPlease check these examples:\r\n\r\n```bash\r\n# Works:\r\naws s3api put-object \\\r\n  --bucket dev.s3.transload.it \\\r\n  --debug \\\r\n  --body ./failing-utf8.jpg \\\r\n  --key failing-utf8.jpg \\\r\n  --acl public-read \\\r\n  --content-type image/jpeg \\\r\n  --content-disposition attachment; filename=5小時接力起跑.jpg;\r\n\r\n# Escape '=' in disposition\r\n# Fails with: filename=5小時接力起跑.jpg: command not found\r\naws s3api put-object \\\r\n  --bucket dev.s3.transload.it \\\r\n  --debug \\\r\n  --body ./failing-utf8.jpg \\\r\n  --key failing-utf8.jpg \\\r\n  --acl public-read \\\r\n  --content-type image/jpeg \\\r\n  --content-disposition attachment; filename\\=5小時接力起跑.jpg;\r\n\r\n# Escape ';' in disposition\r\n# Fails with: UnicodeEncodeError: 'ascii' codec can't encode characters in position 27-32: ordinal not in range(128)\r\naws s3api put-object \\\r\n  --bucket dev.s3.transload.it \\\r\n  --debug \\\r\n  --body ./failing-utf8.jpg \\\r\n  --key failing-utf8.jpg \\\r\n  --acl public-read \\\r\n  --content-type image/jpeg \\\r\n  --content-disposition attachment\\; filename=5小時接力起跑.jpg;\r\n\r\n# Escape ' ' in disposition\r\n# Fails with: filename=5小時接力起跑.jpg: command not found\r\naws s3api put-object \\\r\n  --bucket dev.s3.transload.it \\\r\n  --debug \\\r\n  --body ./failing-utf8.jpg \\\r\n  --key failing-utf8.jpg \\\r\n  --acl public-read \\\r\n  --content-type image/jpeg \\\r\n  --content-disposition attachment;\\ filename=5小時接力起跑.jpg;\r\n```\r\n\r\n\r\nMy environment:\r\n\r\n```bash\r\n$ bash -xc \"lsb_release -ds; bash --version |head -1; aws --version; env |egrep '(LC_|LANG)'\"+ lsb_release -ds\r\n+ lsb_release -ds\r\nUbuntu 12.04.5 LTS\r\n+ bash --version\r\n+ head -1\r\nGNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)\r\n+ aws --version\r\naws-cli/1.7.4 Python/2.7.8 Linux/3.13.0-39-generic\r\n+ env\r\n+ egrep '(LC_|LANG)+'\r\nLC_ALL=en_US.UTF-8\r\nLANG=en_US.UTF-8\r\nLANGUAGE=en_US.UTF-8\r\nLC_CTYPE=en_US.UTF-8\r\nLC_TIME=en_US.UTF-8\r\n```\r\n\r\nWhile we can work around this this by not escaping spaces, semicolons and equal signs (which admittedly is overeager / not necessary), I suspect there might be a bug that causes this behavior and would like to know if you can shed some light on it. Shouldn't escaped chars as used in the failing examples just become chars with no special meaning, and that's that?\r\n\r\nKind regards,\r\nKevin"}}