{"action":"created","issue":{"url":"https://api.github.com/repos/boto/boto3/issues/931","repository_url":"https://api.github.com/repos/boto/boto3","labels_url":"https://api.github.com/repos/boto/boto3/issues/931/labels{/name}","comments_url":"https://api.github.com/repos/boto/boto3/issues/931/comments","events_url":"https://api.github.com/repos/boto/boto3/issues/931/events","html_url":"https://github.com/boto/boto3/issues/931","id":197928735,"number":931,"title":"AttributeError: 's3.Bucket' object has no attribute 'get_key'","user":{"login":"alexcroox","id":1065835,"avatar_url":"https://avatars.githubusercontent.com/u/1065835?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcroox","html_url":"https://github.com/alexcroox","followers_url":"https://api.github.com/users/alexcroox/followers","following_url":"https://api.github.com/users/alexcroox/following{/other_user}","gists_url":"https://api.github.com/users/alexcroox/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcroox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcroox/subscriptions","organizations_url":"https://api.github.com/users/alexcroox/orgs","repos_url":"https://api.github.com/users/alexcroox/repos","events_url":"https://api.github.com/users/alexcroox/events{/privacy}","received_events_url":"https://api.github.com/users/alexcroox/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-28T23:00:56Z","updated_at":"2016-12-29T19:19:06Z","closed_at":"2016-12-29T18:34:28Z","body":"```\r\nimport boto3\r\nfrom botocore.client import Config\r\n\r\ns3 = boto3.resource('s3', config=Config(signature_version='s3v4'))\r\nfileExists = s3.Bucket(\"bucket-name\").get_key(\"key-path\")\r\n```\r\n\r\nErrors with\r\n\r\n`AttributeError: 's3.Bucket' object has no attribute 'get_key'`\r\n\r\nBut it's documented here:\r\n\r\nhttp://boto.cloudhackers.com/en/latest/ref/s3.html#boto.s3.bucket.Bucket.get_key"},"comment":{"url":"https://api.github.com/repos/boto/boto3/issues/comments/269679138","html_url":"https://github.com/boto/boto3/issues/931#issuecomment-269679138","issue_url":"https://api.github.com/repos/boto/boto3/issues/931","id":269679138,"user":{"login":"alexcroox","id":1065835,"avatar_url":"https://avatars.githubusercontent.com/u/1065835?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcroox","html_url":"https://github.com/alexcroox","followers_url":"https://api.github.com/users/alexcroox/followers","following_url":"https://api.github.com/users/alexcroox/following{/other_user}","gists_url":"https://api.github.com/users/alexcroox/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcroox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcroox/subscriptions","organizations_url":"https://api.github.com/users/alexcroox/orgs","repos_url":"https://api.github.com/users/alexcroox/repos","events_url":"https://api.github.com/users/alexcroox/events{/privacy}","received_events_url":"https://api.github.com/users/alexcroox/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T19:19:06Z","updated_at":"2016-12-29T19:19:06Z","body":"For anyone looking for a solution in Boto3 as it was removed this worked for me\r\n\r\n```\r\ns3Client = boto3.client(\"s3\", region_name=\"eu-west-2\")\r\n\r\ntry:\r\n    s3Client.head_object(Bucket=\"bucket-name\", Key=\"key-name\")\r\nexcept:\r\n   # Doesn't exist\r\n```\r\n\r\nNot ideal using exceptions in this way but there doesn't appear to be an alternative without a more expensive list all objects approach."}}
{"actor":{"display_login":"alexcroox"}}