Skip to content

Cannot compile version 6.0.1 for Python 3.14 32bits on Windows #300

@fjumelle

Description

@fjumelle

Things to check first

  • I have searched the existing issues and didn't find my bug already reported there

  • I have checked that my bug is still present in the latest release

cbor2 version

6.0.1

Python version

Python 3.14 32 bits Windows

What happened?

When compiling the version 6.0.1 for Python 3.14 32 bits on Windows, I get this error:
error: literal out of range for usize
--> decoder.rs:1616:36
|
1616 | ... 65536..4294967296 => length >= 6,
| ^^^^^^^^^^ this value does not fit into the type usize whose range is 0..=4294967295

error: literal out of range for usize
--> encoder.rs:326:28
|
326 | 65536..4294967296 => length >= 7,
| ^^^^^^^^^^ this value does not fit into the type usize whose range is 0..=4294967295

while it is working fine when compiling it for Python 3.14 34 bits.

Replacing 4294967296 by 4294967295 in both files decoder.rs and encoder.rs resolves the compilation issue but as I do not know rust at all, I do not know whether this solution is acceptable.

How can we reproduce the bug?

python -m pip install cbor2-6.0.1.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions