From dfb658653f171b13cff8fc6cce15cb7255d2b595 Mon Sep 17 00:00:00 2001 From: Maria Khrustaleva Date: Wed, 18 Jan 2023 08:15:24 +0200 Subject: [PATCH] Fix Upload data annotation from CVAT to Azure Blob storage (#5596) Fix issue #5149 --- CHANGELOG.md | 1 + cvat/apps/engine/cloud_provider.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf3c5a17..e0fe0783 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Helm: Empty password for Redis () - Fixed HRNet serverless function runtime error on images with alpha channel () - Preview & chunk cache settings are ignored () +- Export annotations to Azure container () ### Security - Fixed vulnerability with social authentication () diff --git a/cvat/apps/engine/cloud_provider.py b/cvat/apps/engine/cloud_provider.py index 0bacf222..a97388ec 100644 --- a/cvat/apps/engine/cloud_provider.py +++ b/cvat/apps/engine/cloud_provider.py @@ -1,4 +1,4 @@ -# Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2021-2023 Intel Corporation # # SPDX-License-Identifier: MIT @@ -455,8 +455,8 @@ class AzureBlobContainer(_CloudStorage): def upload_file(self, file_path, file_name=None): if not file_name: file_name = os.path.basename(file_path) - with open(file_path, 'r') as f: - self.upload_fileobj(f, file_name) + with open(file_path, 'rb') as f: + self.upload_fileobj(f.read(), file_name) # TODO: # def multipart_upload(self, file_obj):