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

support memoryviews even on bytearray? #78

Closed
ThomasWaldmann opened this issue Mar 28, 2015 · 6 comments
Closed

support memoryviews even on bytearray? #78

ThomasWaldmann opened this issue Mar 28, 2015 · 6 comments

Comments

@ThomasWaldmann
Copy link

Seems like attic (which is py3 only) would want to give a memoryview on a bytearray (called data) to blosc's compress, but it doesn't get accepted there, so I would have to use bytes(data) to first convert to an acceptable type - and this would make a full new copy of it, right?

I tried to losen the first type check in blosc to accept memoryviews also, but then it just fails a little later with:

    return _ext.compress(bytesobj, typesize, clevel, shuffle, cname)
TypeError: must be read-only pinned buffer, not memoryview

Seems like code like that (see HAS_NEW_BUFFER) might be useful (but please check, I am not familiar with low-level stuff):

https://github.com/dlitz/pycrypto/pull/81/files#diff-d29a5dec14d8ca1fc5d169320636fc52R631

@esc
Copy link
Member

esc commented Mar 28, 2015

I ran into this too, see #65

@esc
Copy link
Member

esc commented Mar 28, 2015

Thanks for the research, check #80 for a potential solution.

@esc
Copy link
Member

esc commented May 26, 2015

@ThomasWaldmann #80 was merged to master I'd really appreciate if you could check it out.

@esc
Copy link
Member

esc commented Jun 1, 2015

There is now also #94 for decompressing from a memoryview or bytearray.

@FrancescAlted
Copy link
Member

@ThomasWaldmann Could you check if the newest release fixes this issue?

@esc
Copy link
Member

esc commented Oct 24, 2016

ping! I'll close this under the vague assumption that it has been fixed. Feel free to open a new ticket if this is a mistake.

@esc esc closed this as completed Oct 24, 2016
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

No branches or pull requests

3 participants