Repository navigation
Releases
Releases · Backblaze/b2-sdk-python
2.13.6
Fixed
- Serialize account database schema migrations so concurrent SDK instances do not apply the same upgrade twice. (#232)
- Escape control characters in the remote file name printed when a sync action fails. (#631)
- Stream hashing now continues reading until the requested length or the true end of data. Previously a source that returned a short read before EOF could produce a checksum and length covering only a prefix, allowing a truncated body to be uploaded with a matching hash. (#654)
- Preserve destination-only paths during sync deletion when excluded by name or directory, or when any B2 version is excluded by a time policy. (#736)
- Accept profile names containing a dot (e.g.
work.prod) again; they were rejected after profile names started being validated against the whole string. Path separators and names made only of dots remain rejected. (#803) - Validate sync download and deletion destinations with make_write_path, refuse existing temporary download paths, and stop retaining SQLite connections from completed worker threads; an unsafe destination aborts down-sync. (#806)
- Create files downloaded by sync with the usual permissions (0o666 filtered by the umask) instead of making them executable on POSIX platforms. (#809)
- Accept matching percent-encoded SSE-C key identifiers in upload metadata without double encoding, while rejecting conflicting identifiers. Add request, encryption and Object Lock unit tests across the supported SDK interfaces.
- Allow notification rules to be supplied as any iterable.
- Allow stream range uploads with an unspecified length to read and calculate their size.
- Allow the v0 bucket interface to unhide files.
- Allow v0 and v1 clients to download files stored with a Content-Encoding.
- Avoid replaying create-style JSON API calls after response timeouts, connection loss, or 5xx responses, including 503. Unlike the general 503 retry guidance, an uncertain create outcome is surfaced so callers can check server state before trying again. Replayable operations retain their retry policy; rate limits and proven connection-establishment failures are still retried.
- Bound server-provided retry delays to between zero and five minutes.
- Clear cached bucket names after deleting a bucket.
- Compare the Pydantic major version numerically when detecting optional validation support.
- Fix folder scans when an object has the same name as the source folder, preserving exact-object listing behavior. Ensure sync waits for queued actions to finish before returning a scheduling error.
- Fix importing vendored or uninstalled copies of the SDK by using a fallback version when package metadata is unavailable.
- Fix reading a chained stream when the size is omitted or None.
- Fixed custom upload timestamps for multipart uploads and their resumption.
- Fixed incorrect symlink loop detection when directories on different devices have the same inode number.
- Fixed locale-dependent formatting of HTTP expiration dates.
- Fixed sync download finalization and escaped control characters in sync completion messages.
- Honor filters when listing an exact file name.
- Map connection errors with missing exception arguments to B2 connection errors without raising IndexError.
- Preserve destination versions when a sync replacement transfer fails.
- Preserve existing credentials and bucket caches when authorization is rejected because a restricted bucket no longer exists.
- Preserve the source content type when copying with header overrides and avoid inheriting an incorrect checksum for ranged copies.
- Protect new account configuration directories, validate profile names, and close cached SQLite connections across threads.
- Protect upload data in representations, close checksum streams, and validate local file range offsets.
- Raise a clear error when saving a consumed download again, before modifying the destination.
- Reading a range stream with a negative size no longer returns bytes past the end of the configured range.
- Refresh pooled upload URLs when the authorization key changes, including when uploads or upload URL requests are in progress.
- Reject incorrect upload checksums under Python optimization, cancel pending multipart work after a part fails, and avoid copying unbound upload buffers.
- Reject local paths that fall outside the sync root, Windows device names and streams, and ASCII control characters in file names. Paths that a sync writes or deletes are also refused when they resolve through a symlink to a location outside the sync root; scanning still follows symlinks.
- Reject manually continuing an unfinished large file when an explicitly requested encryption, retention, or legal-hold setting differs from the unfinished file. Omitted settings are not compared.
- Restore the raw simulator encryption-check flag after an exception inside
dont_check_encryption, so later simulator checks are not left disabled (affects the test model only). - Show the returned bucket name in the assertion message when bucket creation returns a different name.
- Simplify and clarify the error messages raised for concurrent-upload responses.
- The session no longer turns
EmailNotVerifiedandNoPaymentHistoryinto a plainUnauthorized, so uploads fail right away instead of being retried. - Treat Bucket.upload min_part_size as a lower limit while retaining the account recommended upload part size.
Doc
- Fix the Quick Start examples to match the public
b2sdk.v3interface:EncryptionSettingrather thanEncryptionSettings,EncryptionKey(key_id=...)rather thanid=, both required mappings forBasicSyncEncryptionSettingsProvider, andfile_info=rather thanfile_infos=. (#584) - Use
update_file_retentioninstead ofupdate_file_legal_holdin the Quick Start file-lock examples that pass aFileRetentionSetting. (#585) - Fix the Advanced usage patterns guide to reference
UploadSourceLocalFilerather than the nonexistentLocalUploadSource, and to callbucket.create_filerather than an undefinedplannerobject. (#586) - Remove the nonexistent
deployNox session from the Contributors Guide and describe how releases are actually published by the Continuous Delivery workflow. (#588) - Correct the stale CI test matrix description in the contributor guides, which claimed eight Python versions instead of the currently supported set. (#589)
- Correct the Installation Guide's development-install instructions, which told readers to check out the repository and then install the published package from PyPI instead of their local checkout. (#590)
- Fix typos in the Advanced usage patterns guide and remove an outdated time-relative claim about the library's age from the overview. (#591)
- Document how to choose a location for a new test in the Contributors Guide, covering the shared unit directories, the per-interface
v0-v3directories,v_all, integration tests, theapivermarker, and a checklist for changes tob2sdk/_internal. (#592) - Expand the release guide into a maintainer runbook covering prerequisites, the changelog build, the commit/CI/tag sequence, what the Continuous Delivery workflow does, post-release verification, and recovery before and after a tag is pushed. (#593)
- Add a task-oriented replication guide covering setup, required application-key capabilities, per-file replication status, monitoring and how to read a scan report, plus API reference pages for the public replication classes. (#595)
- Consolidate contributor guidance into the published Contributors Guide, and reduce
CONTRIBUTING.mdto a short entry point that links to it, so the two copies can no longer drift apart. (#599) - Resolve the embedded documentation TODOs: drop the obsolete ones, make the "Why use b2sdk?" list consistent and linked, and document the progress reporters and the exception hierarchy properly. (#601)
- Add a writing style guide for SDK documentation and docstrings. (#741)
- Add a documentation index for SDK entry points. (#742)
- Add a link to the B2 Model Context Protocol server in SDK documentation. (#743)
- Add a guide to the SDK test levels and verification practices. (#744)
- Corrected bucket and large-file API docstrings to match their behavior. (#745)
- Correct the sync and scan docstrings to match their current behavior. (#746)
- Correct quick start and tutorial examples for the v3 API. (#763)
- Correct documentation for application keys...
2.13.5
Infrastructure
- Make the sdkharness legal-hold delete check accept B2's
401 access_deniedresponse while retaining older simulator refusal shapes.
2.13.4
Fixed
- Notification-rule methods and B2 error interpretation no longer record request arguments (including signing secrets, custom headers, and SSE-C keys) in SDK debug tracing.
2.13.3
Fixed
- Accept
reporter=NoneinSynchronizer.sync_foldersby using a silent reporter instead of failing. - Keep scanning a local folder after a file cannot be read or accessed when no reporter is given, instead of failing on that file.
- Parallel download: hash the data that was actually written, and surface a failing writer to producers instead of blocking them or losing the error.
- Pass
expires,content_disposition,content_encodingandcontent_languagethroughBucket.copyto the created file instead of dropping them. - Send
customUploadTimestampunder its B2 wire name when starting a large file, so custom upload timestamps are no longer ignored. - Stop the replication monitor from hanging when its consumer fails: the producer no longer blocks on a full queue and always signals the end of input.
- Store the account's allowed capabilities in SQLite with a bound parameter instead of string formatting, and reset cached upload pools when
SqliteAccountInfo.clear()is called.
Infrastructure
2.13.2
Changed
- Require certifi 2026.10.19 or newer.
Infrastructure
- Make the sdkharness
upload.stallcheck runnable: it meets its request-timeout need through the documentedB2HttpApiConfig(http_session_factory=...)instead of reportingno-client-option. - Require pip 26.2.2 or newer in the Nox runner, lint, build, and test environments and update GitHub Actions to uv 0.13.4 to address the emSign CA certificate security incident.
2.13.1
Fixed
- Retry uploads after a B2 request-timeout response (HTTP 408). (#605)
- Fixed honoring the Retry-After header on 5xx service errors. (#606)
Infrastructure
- Added a repository-owned sdkharness customer-health contract for version-matched simulator testing. (#610)
- Moved sdkharness conformance and resilience assertions into this repository so they execute against the exact b2sdk checkout. (#612)
- Document in the sdkharness README how to run one check against the standalone simulator, and list every proxy variable the leaf checks scrub.
- Make the sdkharness leaf-check unit tests ignore
__pycache__and other non-leaf entries. - Repository-owned conformance checks
lock.bypass_governanceandlock.per_file_retentionaccept the 401access_deniedthat B2 answers for a delete of a governance-locked version without bypass, and still fail if the delete is allowed or refused for an unrelated reason. - Repository-owned sdkharness conformance and resilience checks now report an authorization error, access denied, a connection error against the simulator, or an SDK
ImportErrorasFAILinstead ofCOULD-NOT-RUN/SKIP, strip proxy environment variables so a stray proxy cannot change a result, and no longer refer to files that exist only in the central harness. - Repository-owned sdkharness conformance and resilience leaf checks now refuse to run unless they are given a loopback simulator URL, and always use the fixed simulator credential, so running one directly can no longer reach staging or production with ambient
B2_*credentials. - The repository-owned resilience dispatcher refuses a simulator that has already served requests, instead of letting a leaf count an earlier scenario's journal entries (for example
upload.cap_exceeded_403reporting extrab2_upload_filecalls) and report a false SDK failure.
2.13.0
Changed
- Follow B2's switch to SSE-B2 as the default server-side encryption: an omitted encryption setting now means the server default (SSE-B2) for both bucket defaults and file writes, and an explicit
noneis rejected before the request is sent, withWrongEncryptionModeForBucketDefaultfor bucket create/update and the newWrongEncryptionSettingForFileWritefor uploads and copies.RawSimulatorapplies the same rules.
Added
- Add
EncryptionSetting.can_be_used_for_file_write()and theWrongEncryptionSettingForFileWriteexception.
Infrastructure
- Add a build-time smoke test that installs the freshly built source distribution and imports the public API shims.
- Add a checked-in Read the Docs build configuration so docs builds install the required doc dependencies and system packages.
- Bump urllib3 from 2.6.3 to 2.7.0.
- Run B2 CLI unit tests and integration tests in CI against the SDK checkout.
2.12.0
Removed
- Drop support for Python 3.9 and PyPy 3.9.
Infrastructure
- Upgrade test dependencies versions.
2.11.0
Fixed
- Handle null case when encoding / decoding
content_sha1in BaseFileVersion. (#553) - Fix
SqliteAccountInfoto explicitly close temporary sqlite connections used during setup, add aclose()method for cached connection.
Added
- Declare official support for Python 3.14 and include it in the CI test matrix.
- Introduce a reusable validator to ensure remote B2 file names are safe to use as local paths.
Infrastructure
- Bump tornado dependency from 6.5.4 to 6.5.5.
2.10.4
Fixed
- Fixed a retry bug in
upload_unbound_stream()small-file uploads where a retryable upload error could cause a one-shot buffered stream to be reopened after it was closed, raisingValueError: I/O operation on closed file.
Infrastructure
- Add exponential retries for bucket creation in
testing.helpers.BucketManager. - Fix redudant files in the sdist after migrating from
pdmtouv.