boto / boto3

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

CodeCommit get_file not actually base64 encoded #2329

Open laurelmay opened 4 years ago

laurelmay commented 4 years ago

Describe the bug The CodeCommit get_file documentation states that the file contents are returned as base64-encoded. This is not actually the case.

Steps to reproduce

import boto3
import base64

client = boto3.client('codecommit')
result = client.get_file(respositoryName=repo, filePath=path)
# Results in an error since the result is not valid base64
base64.b64decode(result['fileContent'])
# View the data
print(result['fileContent'])

Compare this to:

aws codecommit get-file --repository-name repo --file-path path --query fileContent --output text

Expected behavior The expected behavior is that the data is base64 encoded. If that is not the case, the documentation should be corrected.

Debug logs The error does not occur directly in boto3.

swetashre commented 4 years ago

@kylelaker - Thank you for your post. I am able to reproduce the issue. Marking this as a bug.

github-actions[bot] commented 3 years ago

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.

laurelmay commented 3 years ago

This is still a bug. The documentation still says the return value is base64-encoded and the returned data still is not. One or the other should still be corrected.

dennisvang commented 4 months ago

still not fixed