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

Store bytes in memcached session, but always return native strings #1476

Merged
merged 5 commits into from Aug 27, 2016

Conversation

@webknjaz
Copy link
Member

@webknjaz webknjaz commented Aug 21, 2016

Fix #1453

@jaraco
Copy link
Member

@jaraco jaraco commented Aug 21, 2016

ntob and tonative are deprecated constructs, so probably shouldn't be used here. An the very least, I think the change to _set_id is no better than the implementation that's in place now. Why ensure it's unicode just to convert it to bytes?

I can see the value in the change to _get_id as it provides backward compatibility for older versions of python-memcached on Python 2.

Personally, I'd be inclined to drop support for older versions of python-memcachd, and remove all of this workaround code altogether. What do you think?

@webknjaz
Copy link
Member Author

@webknjaz webknjaz commented Aug 22, 2016

Well, I think to do so we need to add dependency restriction.
I suggest adding extras to setup.py.
It would be useful for end-users as well. If they want to use memcached backed sessions they'll just specify (e.g.) cherrypy[memcached-sessions] and won't need to track memcached client version themselves.

@webknjaz
Copy link
Member Author

@webknjaz webknjaz commented Aug 26, 2016

@jaraco I think now it's OK to merge it

@jaraco
Copy link
Member

@jaraco jaraco commented Aug 27, 2016

Looks good to me. Can you add a CHANGES.rst entry as well?

@webknjaz
Copy link
Member Author

@webknjaz webknjaz commented Aug 27, 2016

Sure, done. Merging PR :)

@webknjaz webknjaz merged commit ce79280 into cherrypy:master Aug 27, 2016
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@webknjaz webknjaz mentioned this pull request Aug 28, 2016
29 of 29 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Bugs
Fixed
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.