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

deprecate pickleable sessions, recommend json #3353

Merged
merged 6 commits into from
Sep 27, 2018

Conversation

mmerickel
Copy link
Member

This change is backward-compatible but emits deprecation warnings when using the default PickleSerializer with SignedCookieSessionFactory.

I was also going to deprecate it in UnencryptedCookieSessionFactoryConfig but that entire thing has been deprecated since 1.5 and is definitely getting removed in 2.0 wholesale, so there's no point in deprecating a small part of it.

replaces #3341
related #2709

@mmerickel mmerickel force-pushed the deprecate-pickle-sessions branch from c4f30bd to c318834 Compare September 16, 2018 16:24
CHANGES.rst Show resolved Hide resolved
CHANGES.rst Show resolved Hide resolved
CHANGES.rst Show resolved Hide resolved
CHANGES.rst Outdated Show resolved Hide resolved
docs/narr/sessions.rst Outdated Show resolved Hide resolved
docs/narr/sessions.rst Show resolved Hide resolved
@mmerickel mmerickel added this to the 1.10 milestone Sep 17, 2018
@digitalresistor
Copy link
Member

👍

@jvanasco
Copy link
Contributor

I like the example 'pickle fallback' code, but i think it would make sense for the docs to list some of the common objects that not JSON serializable (namely Datetime) and show an example JSON encoder/decoder using object_hooks to enable it. I imagine this would pre-empt many questions, and serve as a resource to point people having trouble to.

The renderers documentation (https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/renderers.html) does something similar, however it uses the standard serializer and add_adapter.

@mmerickel
Copy link
Member Author

i think it would make sense for the docs to list some of the common objects that not JSON serializable (namely Datetime) and show an example JSON encoder/decoder using object_hooks to enable it.

I'm not interested in doing this. Feel free to submit a PR and I'll evaluate it but I have no intentions of supporting this type of stuff in the default json serializer on my own.

@stevepiercy
Copy link
Member

@jvanasco your PR may be useful as a recipe in the Pyramid Community Cookbook, if not in Pyramid's docs, or you could blog about it, and Pyramid docs could have a link to it.

@jvanasco
Copy link
Contributor

ok, i'll generate a PR for some docs once this ticket closes out. I don't think the default serializer should handle datetime/etc natively; but i do think the docs should instruct users on how they can extend the session serializer to handle other objects - especially if pickle is being presented as a fallback.

@digitalresistor digitalresistor merged commit 279ee00 into Pylons:master Sep 27, 2018
@mmerickel mmerickel deleted the deprecate-pickle-sessions branch November 29, 2020 03:11
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 this pull request may close these issues.

4 participants