- azure-storage-blob:
- Version 12.19.1:
- Windows 10:
- Python 3.10.6:
- Over 10k files:
Describe the bug 当try 从Azure Blob存储容器检索Blob名称列表时,遇到"错误填充"错误.这个问题似乎在有效获取blob名称方面造成了障碍,即使blob上传和下载操作已经成功.
Code Snippet:
try:
# Get the list of blobs in the container
blob_list = self.container_client.list_blobs()
print("List of blobs:")
for blob in blob_list:
print(blob.name)
except Exception as e:
print(f"An error occurred while retrieving the list of blobs: {str(e)}")
Error Message:.
Incorrect padding
.
Additional Successful Operations:
- Blob上载
def upload(self, blob_data, blob_name):
try:
# Upload a blob to the container
self.container_client.upload_blob(name=blob_name, data=blob_data)
print(f"Blob '{blob_name}' uploaded successfully.")
except Exception as e:
print(f"An error occurred while uploading blob '{blob_name}': {str(e)}")
- 下载BLOB
def download(self, blob_name):
try:
# Get the BlobClient for the blob
blob_client = self.container_client.get_blob_client(blob_name)
# Download the blob to a local file
with open(blob_name, "wb") as blob:
download_stream = blob_client.download_blob()
blob.write(download_stream.readall())
print(f"Blob '{blob_name}' downloaded successfully.")
except Exception as e:
print(f"An error occurred while downloading blob '{blob_name}': {str(e)}")