Skip to content

Fix reading a chained stream without an explicit size - #706

Merged
ffumero2003 merged 1 commit into
masterfrom
fix-py-chained-size-none
Nov 21, 2026
Merged

ffumero2003 merged 1 commit into
masterfrom
fix-py-chained-size-none

Conversation

@ffumero2003

Copy link
Copy Markdown
Contributor

Context

Reading a chained stream with the default size (None) raised TypeError because size < 0 was evaluated before the None check.

Changes

Check for None before comparing size with zero (if size is None or size < 0).

Verification

Both C11 regressions (read() and read(None)) red on master, green after; stream unit suite passes; ruff + towncrier pass. SDK panel: PASS.

Refs #703

@ffumero2003 ffumero2003 self-assigned this Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8e599a71-1f65-432b-9c64-2a015648f9cb
Commits

Reviewing files that changed from the base of the PR and between 84ce6f5 and 9f6d060.

Files selected for processing: 3

  • b2sdk/_internal/stream/chained.py
  • changelog.d/+chained-stream-read-none.fixed.md
  • test/unit/stream/test_regression_streams.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@ffumero2003
ffumero2003 merged commit 2ff39de into master Nov 21, 2026
29 checks passed
@ffumero2003
ffumero2003 deleted the fix-py-chained-size-none branch November 21, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant