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

added support for buffer / memoryview data #108

Open
wants to merge 1 commit into
base: kinetic-devel
Choose a base branch
from

Conversation

tzickel
Copy link

@tzickel tzickel commented Aug 28, 2019

Before testing, I rather get feedback if this is a sane / valid solution... (i.e. first trying with an exception handler), also it might fail on non trivial layouts (not sure if fail exception as would before, or fail by sending wrong data?).

Trying to fix #107

Copy link
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also it might fail on non trivial layouts

Please do extensive testing of the proposed patch. Since this is a fairly low level and important package we needs to be pretty confident that this doesn't break anything in order to be considered for merging.

yield INDENT+"tmp = memoryview(%s) if python3 else buffer(%s)"%(var,var)
yield INDENT+pack2("'<I'", "tmp.nbytes if python3 else len(tmp)")
yield INDENT+serializeit("tmp")
yield "except:"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't catch arbitrary exception but only specific types which are expected to be thrown. Also the scope of the try / except block should be as short as possible.

@dirk-thomas
Copy link
Member

@tzickel Friendly ping.

@peci1
Copy link

peci1 commented Nov 25, 2022

A continuation of this PR is in #147 .

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

Successfully merging this pull request may close these issues.

memoryview / buffer inputs should be accepted as serializable data
3 participants