boto / boto3

AWS SDK for Python
https://aws.amazon.com/sdk-for-python/
Apache License 2.0
8.99k stars 1.86k forks source link

Document of S3.Client.download_file uses the resource interface #4127

Closed debugger-zhang closed 4 months ago

debugger-zhang commented 4 months ago

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

tim-finnigan commented 4 months ago

Thanks - it looks like the download_file example should be consistent with upload_file here. Created https://github.com/boto/boto3/pull/4128 to update.

github-actions[bot] commented 4 months ago

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.