Skip to content

Medium audit fixes: bucket/stream/profile correctness (8 findings) #703

Closed

Description

@ffumero2003

Medium correctness findings from the SDK audit, all verified to reproduce on current main. Group by file for independent PRs.

bucket.py (+copy):

  • C5 bucket.py:418-430 exact-file branch sets path_pointed_to_file for ANY returned version (no file_name==path check) -> ls/sync crash at scan/folder.py:377. Fix: require file_name == path.
  • C35 bucket.py:1558 generator/set for rules isn't JSON-serializable despite the Iterable hint. Fix: list(rules).
  • C32 bucket.py:145 strftime '%a/%b' is locale-dependent. Fix: locale-independent HTTP date.
  • C1 copy_manager.py:161-163 raises CopyArgumentsMismatch when expires/content-* set but content_type is None (bucket.py:1458). Fix: carry source content type / REPLACE.

other files:

  • C11 chained.py:100 if size < 0 or size is None -> None<0 TypeError on default read(). Fix: reorder size is None or size < 0.
  • C47 sqlite_account_info.py:130 profile_file not expanduser-ed (128 is) -> legacy profile DB missed on XDG OSes. Fix: expanduser.
  • C36 version.py:21 _version('b2sdk') has no fallback -> PackageNotFoundError for a vendored copy. Fix: try/except fallback.
  • C56 downloaded_file.py:197 a second save() re-reads the exhausted response -> TruncatedOutput. Fix: consumed flag + clear error.

Acceptance: a test proves each; no unrelated changes.

Activity

  1. self-assigned this
    on Nov 21, 2026
  2. added theissue type on Nov 21, 2026
  3. ffumero2003 commented on Nov 21, 2026

    @ffumero2003
    ContributorAuthor

    All findings merged: C35 #704, C32 #705, C11 #706, C36 #707, C56 #708, C1 #709, C47 #710.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions