Bucket.download_file_by_name fails when getting bucket with B2Api.get_bucket_by_id
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Start with download_file_by_name() in b2sdk/bucket.py, which assumes self.name is set, and compare it with get_bucket_by_name() to see how a Bucket built by B2Api.get_bucket_by_id() gets its name. Reproduce with the snippet in the issue, then check that a download by name works after fetching the bucket by id. The work is probably already superseded in the current release, so confirm against the latest code before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
After getting a Bucket instance by calling B2Api.get_bucket_by_id(), I'm unable to download files with bucket.download_file_by_name(). A minimal example of the problem:
from b2sdk.v1 import InMemoryAccountInfo, B2Api, DownloadDestLocalFile
app_id = '<app_id>'
app_key = '<app_key>'
bucket_id = '<bucket_id>'
bucket_name = '<bucket_name>'
b2 = B2Api(InMemoryAccountInfo())
b2.authorize_account('production', app_id, app_key)
bucket = b2.get_bucket_by_id(bucket_id)
# bucket = b2.get_bucket_by_name(bucket_name)
dst = DownloadDestLocalFile('local_file_name')
bucket.download_file_by_name('<b2_file_path>', dst)
If the commented line that calls get_bucket_by_name() is used instead, the snippet works as expected.
Tried both v1.0.2 on PyPI and installing directly from master (more specifically 1707190972a5d6807c7d928dd5d295dce6920915).
The problem seems to be that the Bucket class assumes that its name attribute is always set in download_file_by_name() which is not a correct assumption when the bucket is instantiated with B2Api.get_bucket_by_id().
Is this a bug or have I missed something in the documentation?
- Ngôn ngữ chính
- Python
- Star
- 214
- Fork
- 68
- Merge trung bình
- 51 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Backblaze/b2-sdk-python
-
Download and copy sync actions print remote file names without escape_control_charsCó thể đã có người làm @dreyfus92 đã nhận 15 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Backblaze/b2-sdk-python#631 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SqliteAccountInfo profile name validation uses "re.match", so only the first character is checkedCó thể đã có người làm @nazarli-shabnam đã nhận 9 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Backblaze/b2-sdk-python#629 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Adopt the AI-native SDLC and repository policiesCó thể đã có người làm @goanpeca đã nhận 18 ngày trước. Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Backblaze/b2-sdk-python#634 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
Backblaze/b2-sdk-python#630 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci: cli-compat fails — 4 sse/sync integration tests broken in B2_Command_Line_Tool (all environments)Có thể làm lại được @ffumero2003 đã nhận 37 ngày trước và không có pull request nào đang mở. Đang mởbug testing
Backblaze/b2-sdk-python#627 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Backblaze/b2-sdk-python
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
btclib-org/btclib-node#2505 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
open-webui/open-webui#34462 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gorakhargosh/watchdog#1462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
openwisp/openwisp-monitoring#889 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
IETF-Hackathon/pqc-certificates#351 ·
Maintainer thường phản hồi trong vòng 2 ngày