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

Unsupported types produce corrupted output #2

Closed
pumelo opened this issue Aug 3, 2017 · 3 comments
Closed

Unsupported types produce corrupted output #2

pumelo opened this issue Aug 3, 2017 · 3 comments
Assignees

Comments

@pumelo
Copy link

pumelo commented Aug 3, 2017

If unsupported types are passed to qpack they are silently ignored and a corrupted output produced.

example to reproduce

import qpack, datetime
t = qpack.packb({'d' : datetime.datetime.now()})
qpack.unpackb(t)

From my point of view, this should already fail when packing. I suggest to add something like the following to the end of the _pack function to handle the case where an unsupported type is passed to it:

    else:
        raise TypeError('%s is not supported for packing with qpack'%(type(obj)))

This will raise a TypeError whenever an unsupported type is passed to the function.

@riklempens
Copy link
Member

@pumelo thanks for reporting this issue, as we are currently in the mids of our vacation season our resources are somewhat limited hence the delayed response. My partner @joente will take this forward next week.

@joente
Copy link
Member

joente commented Aug 14, 2017

Fixed by raising a TypeError when trying to pack an unsupported type.
Updated both the C lib, the Python fallback and the test.

@joente joente closed this as completed Aug 14, 2017
@pumelo
Copy link
Author

pumelo commented Aug 15, 2017

Awesome , thank you.

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