{"action":"created","issue":{"url":"https://api.github.com/repos/boto/boto3/issues/700","repository_url":"https://api.github.com/repos/boto/boto3","labels_url":"https://api.github.com/repos/boto/boto3/issues/700/labels{/name}","comments_url":"https://api.github.com/repos/boto/boto3/issues/700/comments","events_url":"https://api.github.com/repos/boto/boto3/issues/700/events","html_url":"https://github.com/boto/boto3/issues/700","id":163250100,"number":700,"title":"ObjectSummary.delete() doesn't work","user":{"login":"pisymbol","id":17936726,"avatar_url":"https://avatars.githubusercontent.com/u/17936726?v=3","gravatar_id":"","url":"https://api.github.com/users/pisymbol","html_url":"https://github.com/pisymbol","followers_url":"https://api.github.com/users/pisymbol/followers","following_url":"https://api.github.com/users/pisymbol/following{/other_user}","gists_url":"https://api.github.com/users/pisymbol/gists{/gist_id}","starred_url":"https://api.github.com/users/pisymbol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pisymbol/subscriptions","organizations_url":"https://api.github.com/users/pisymbol/orgs","repos_url":"https://api.github.com/users/pisymbol/repos","events_url":"https://api.github.com/users/pisymbol/events{/privacy}","received_events_url":"https://api.github.com/users/pisymbol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-30T19:38:55Z","updated_at":"2016-07-12T21:06:25Z","closed_at":null,"body":"https://boto3.readthedocs.io/en/latest/reference/services/s3.html#S3.ObjectSummary.delete\r\n\r\nDoes not work because I believe the key in object summary objects are URL encoded.\r\n\r\nFor example:\r\n\r\n```\r\nbucket = s3.Bucket(<bucket_name>)\r\nfor obj_sum in bucket.objects.all():\r\n     obj_sum.delete()\r\nbucket.delete()\r\n```\r\n\r\nThis doesn't work. However this does:\r\n```\r\n\r\nfrom urllib import unquote_plus \r\n\r\nbucket = s3.Bucket(<bucket_name>)\r\nfor obj_sum in bucket.objects.all():\r\n      obj = s3.Object(bucket_name = <bucket_name>, key = unquote_plus(obj_sum.key))\r\n      obj.delete()\r\nbucket.delete()\r\n\r\n```\r\nSample debug output also points to url encoding as the issue:\r\n\r\n2016-06-30 15:32:07,392 INFO: Calling paginated s3:list_objects with {u'Bucket': u'alex'}\r\n2016-06-30 15:32:07,418 INFO: Calling s3:delete_object with {u'Bucket': u'alex', u'Key': 'test%2Fanothertest'}\r\n^^^^^^^^^^^^^^^^^^\r\n\r\nI'm using botocore-1.4.30-1 and boto3-1.3.1-1 on Centos 6.8, python 2.6 (yeah, yeah, don't ask).\r\n"},"comment":{"url":"https://api.github.com/repos/boto/boto3/issues/comments/232181380","html_url":"https://github.com/boto/boto3/issues/700#issuecomment-232181380","issue_url":"https://api.github.com/repos/boto/boto3/issues/700","id":232181380,"user":{"login":"kyleknap","id":4605355,"avatar_url":"https://avatars.githubusercontent.com/u/4605355?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleknap","html_url":"https://github.com/kyleknap","followers_url":"https://api.github.com/users/kyleknap/followers","following_url":"https://api.github.com/users/kyleknap/following{/other_user}","gists_url":"https://api.github.com/users/kyleknap/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleknap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleknap/subscriptions","organizations_url":"https://api.github.com/users/kyleknap/orgs","repos_url":"https://api.github.com/users/kyleknap/repos","events_url":"https://api.github.com/users/kyleknap/events{/privacy}","received_events_url":"https://api.github.com/users/kyleknap/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T21:06:25Z","updated_at":"2016-07-12T21:06:25Z","body":"How did you install boto3? I was not able to reproduce it. My debug logs even show it get properly decoded when I ran your first code snippet:\r\n```\r\n2016-07-12 14:05:09,006 boto3.resources.factory [DEBUG] Loading s3:ObjectSummary\r\n2016-07-12 14:05:09,007 boto3.resources.model [DEBUG] Renaming ObjectSummary attribute key\r\n2016-07-12 14:05:09,008 boto3.resources.action [INFO] Calling s3:delete_object with {u'Bucket': 'my_bucket_foo', u'Key': u'something with spaces'}\r\n```"}}
{"actor":{"display_login":"kyleknap"}}