Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMQP encoder does not handle large integers #212

Open
wrobell opened this issue Oct 11, 2024 · 2 comments · May be fixed by #214
Open

AMQP encoder does not handle large integers #212

wrobell opened this issue Oct 11, 2024 · 2 comments · May be fixed by #214

Comments

@wrobell
Copy link

wrobell commented Oct 11, 2024

I would like to update RbFly performance tests for AMQP codecs (https://wrobell.dcmod.org/rbfly/performance.html), but it seems the encoder you are using does not support large integers, so the bug report

The following

from rstream.amqp import AMQPMessage
bytes(AMQPMessage(body={'large-int': 2 ** 32 + 1}))

results in

File ~/projects/rbfly/.venv/lib/python3.12/site-packages/rstream/_pyamqp/_encode.py:262, in encode_int(output, value, with_constructor, use_smallest)
    260     output.extend(struct.pack(">i", value))
    261 except struct.error as exc:
--> 262     raise ValueError("Value supplied for int invalid: {}".format(value)) from exc

ValueError: Value supplied for int invalid: 4294967297
@Gsantomaggio
Copy link
Member

Thank you @wrobell we will have a look as soon as poosible

@DanielePalaia DanielePalaia linked a pull request Oct 24, 2024 that will close this issue
@DanielePalaia
Copy link
Collaborator

Hi @wrobell

this branch should solve the issue: #214

Could you test it?

Thanks,
Daniele

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 a pull request may close this issue.

3 participants