kisielk / og-rek

ogórek is a Go library for encoding and decoding pickles.
MIT License
60 stars 16 forks source link

Preliminary support for protocol 5 #63

Closed navytux closed 3 years ago

navytux commented 3 years ago

Pickle protocol 5 adds out-of-band data and BYTEARRAY8 opcode (see [1] and [2]). We add support for BYTEARRAY8 here. Handling out-of-band data would require more setup from users - on both decoding and encoding side, and it is likely that currently no practical use-case exists to work with pickles with out-of-band data on Go side. This way we behave as if no out-of-band data was provided when seeing all protocol 5 opcodes besides BYTEARRAY8.

Hopefully fixes: https://github.com/kisielk/og-rek/issues/62

[1] https://www.python.org/dev/peps/pep-0574 [2] https://github.com/python/cpython/commit/91f4380cedba

navytux commented 3 years ago

@kisielk, FYI: I intend to apply this patch to master in a day or two after taking another fresh look if you don't mind.

kisielk commented 3 years ago

That was fast! LGTM

navytux commented 3 years ago

Thanks, @kisielk!

oz-r commented 3 years ago

Hey folks! Just wanted to follow up on this - will you be publishing a new release with Protocol 5 updates? We've tested 8def3d0 (aren't doing much with it) but hesitant to roll it out into prod without a release.

navytux commented 3 years ago

No problem, I've just pushed v1.2.0 tag out there.

mbautista commented 4 months ago

Hello,

Thank you for this fix :) I think I will need this upgrade for my fail2web/fail2rest setup but I'm not very familiar with go. Could anyone please help me how to upgrade ? I opened an issue here : https://github.com/Sean-Der/fail2web/issues/41

Thank you for your help :) Mathieu.

navytux commented 4 months ago

@mbautista, you need to talk to fail2web maintaner so that ogórek dependency is upgraded there. Or you could try to do corresponding patch yourself. Please see https://go.dev/blog/using-go-modules for the overview of how to work with Go modules.