Skip to content

Azure Storage Blob: delete_blobs returns warning when using list[dict] as argument #12778

@dr-dolittle

Description

@dr-dolittle
  • Package Name: azure.storage.blob
  • Package Version: 12.3.2
  • Operating System: Windows
  • Python Version: 3.8.1

I retrieve blobs matching a certain pattern and then delete them:

from azure.storage.blob import ContainerClient, BlobProperties
from azure.core.paging import ItemPaged
from typing import List

blob_paged: ItemPaged[BlobProperties] = container_client.list_blobs(name_starts_with=prefix)
blob_list: List[dict] = list(blob_paged)
number_of_blobs: int = len(blob_list)

if number_of_blobs > 0:
    container_client.delete_blobs(*blob_list, delete_snapshots="include")
    log.debug(f"Deleted '{ number_of_blobs }' blobs and snapshots...")   
else:
    log.debug(f"No blobs to be deleted...")

It works but it emits the following warning logs for each request made through the deletion process:

Failed to parse headers (url=https://xxx.blob.core.windows.net:443/?comp=batch): [StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()], unparsed data: ''
Traceback (most recent call last):
  File "xxx\__app__\.venv\lib\site-packages\urllib3\connectionpool.py", line 446, in _make_request
    assert_header_parsing(httplib_response.msg)
  File "xxx\__app__\.venv\lib\site-packages\urllib3\util\response.py", line 71, in assert_header_parsing
    raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
urllib3.exceptions.HeaderParsingError: [StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()], unparsed data: ''

Is this intended? If not, can you please fix that?

Thanks

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)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 teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions