Skip to content

Ignored text encoding specified in method parameter #20795

@ryohji

Description

@ryohji
  • Package Name: azure-core
  • Package Version: 1.14.0
  • Operating System: Any (found on Windows)
  • Python Version: 3.9.7

Describe the bug
AioHttpTransportResponse's text method ignores encoding parameter, if it is not None.
When calling azure.storage.blob.aio.BlobClient's stage_block method, its corresponding response "201 created" with empty body. AioHttpTransportResponse#text method ignores request's "uft-8" encoding and get failed guessing encoding against empty body (with chardet). (and chardet package prints "DEBUG" level log "no data received!" and "no probers hit minimum threshold")
This failing encoding guess is harmless but time consuming.

To Reproduce
Steps to reproduce the behavior:

  1. Configure logging level to output "DEBUG" level messages.
  2. Prepare write permitted blob URL on Azure Blob Storage.
  3. Call azure.storage.blob.aio.BlobClient#stage_block and await it.
  4. chardet logger prints "no data received!" and "no probers hit minimum threshold".

Expected behavior
If encoding is specified, respect it.

Screenshots
image

Metadata

Metadata

Assignees

Labels

Azure.CoreClientThis issue points to a problem in the data-plane of the library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions