Skip to content

EmergePlanner() with no arguments raises TypeError: 'int' object is not iterable #701

Open

Description

@sophiecarreras

EmergePlanner() with all three limits left as None fails in __init__.

Repro (master d043d22):

from b2sdk._internal.transfer.emerge.planner.planner import EmergePlanner
EmergePlanner()
# TypeError: 'int' object is not iterable

Cause: b2sdk/_internal/transfer/emerge/planner/planner.py, EmergePlanner.__init__:

min(DEFAULT_MIN_PART_SIZE, *_filter_out_none(recommended_upload_part_size, max_part_size))

With both filtered values None, this becomes min(DEFAULT_MIN_PART_SIZE), and min of a single int raises.

Expected: defaults are used, as the surrounding comment ("ensure default values do not break min<=recommended<=max") implies. Callers that pass at least one limit work, which is likely why this went unnoticed.

Found while adding direct unit tests for _filter_out_none (draft PR #699). No test currently covers the no-argument case, and the new tests avoid it.

🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions