boto / boto3

AWS SDK for Python

Home Page:https://aws.amazon.com/sdk-for-python/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document of S3.Client.download_file uses the resource interface

debugger-zhang opened this issue · comments

Describe the issue

The example of the page currently reads:

import boto3
s3 = boto3.resource('s3')
s3.meta.client.download_file('mybucket', 'hello.txt', '/tmp/hello.txt')

There are no need to use the resource interface, which is currently in maintanence mode. The example should use client interface:

import boto3
s3 = boto3.client('s3')
s3.download_file('mybucket', 'hello.txt', '/tmp/hello.txt')

Links

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/download_file.html

Thanks - it looks like the download_file example should be consistent with upload_file here. Created #4128 to update.

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.