Skip to content

pydantic version check compares version strings as text #657

Open

Description

@sophiecarreras

What happens

The optional pydantic import rejects old versions with pydantic.__version__ < '2', a string comparison. A future version such as '10.0' sorts before '2' and would be treated as too old, silently disabling pydantic support. Not a problem for any 2.x release.

Where

b2sdk/_internal/types.py:32-36.

Why it matters

Impact: Compatibility, silent. Severity: Low, because no pydantic version today triggers it, so there is no current effect.

How to check

In a Python shell, '10.0' < '2' is True. Read types.py:35. Found by reading the code, not reproduced.

Version

Seen at v2.13.4. Present on the default branch: present.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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