-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix reading blob chars in text mode using StorageStreamDownloader.read() #38827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
read() on blob behaves differently when using chars vs size, but this should behave the same (accoring to documentation). This commit fixes discrepancies in number of chars read when specifying negative number in `StorageStreamDownloader.read()`
|
Thank you for your contribution @777moneymaker! We will review the pull request and get back to you soon. |
|
API change check API changes are not detected in this pull request. |
Add None value handling in chars
simplify None and int handling
Remove redundant code
Add handling of chars=0
jalauzon-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I have been away for the holiday season. Thanks for your contribution! This change looks good, but could you please apply the same change to our async implementation here:
azure-sdk-for-python/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py
Line 561 in cfa5ac8
| size = chars if chars else sys.maxsize |
This can be tested using our async clients. Once that's done, we can approve and merge his change, thanks.
Hey, no problem. The change has just been committed. |
|
@microsoft-github-policy-service agree |
|
Hi @777moneymaker Leon, thanks again for your contribution! I have approved and merged this and it will be included in our next release. |
Description
StorageStreamDownloader.read()on blob behaves differently when using chars vs size, but this should behave the same (according to documentation). This single change fixes discrepancies in number of chars read when specifying negative number inStorageStreamDownloader.read()Example
download_blob().read(size=-1)behaves differently thandownload_blob(encoding='utf-8').read(chars=-1)All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines