• 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)}")

推荐答案

请判断一下这个.我希望这个链接对你的项目配置有帮助.

Status 403: This request is not authorized to perform this operation using this permission

Python相关问答推荐

Python中使用时区感知日期时间对象进行时间算术的Incredit

GL pygame无法让缓冲区与vertextPointer和colorPointer一起可靠地工作

仅从风格中获取 colored颜色 循环

如何使用scipy从频谱图中回归多个高斯峰?

三个给定的坐标可以是矩形的点吗

具有多个选项的计数_匹配

@Property方法上的inspect.getmembers出现意外行为,引发异常

Pystata:从Python并行运行stata实例

从numpy数组和参数创建收件箱

Python键入协议默认值

Pandas—合并数据帧,在公共列上保留非空值,在另一列上保留平均值

如何设置视频语言时上传到YouTube与Python API客户端

基于行条件计算(pandas)

Python—压缩叶 map html作为邮箱附件并通过sendgrid发送

如何将一组组合框重置回无 Select tkinter?

删除特定列后的所有列

在pandas中,如何在由两列加上一个值列组成的枢轴期间或之后可靠地设置多级列的索引顺序,

Django抛出重复的键值违反唯一约束错误

具有不匹配列的2D到3D广播

如何在不不断遇到ChromeDriver版本错误的情况下使用Selify?