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

RedisCache only accepts string keys #1152

Closed
mcdallas opened this issue Jul 19, 2017 · 6 comments
Closed

RedisCache only accepts string keys #1152

mcdallas opened this issue Jul 19, 2017 · 6 comments

Comments

@mcdallas
Copy link

Currently RedisCache only accepts string keys due to the 'key_prefix' parameter that gets concatenated to each key. Even SimpleCache accepts integer keys and redis itself even accepts sets as keys.

I am using werkzeug 0.12.2 and Python 3.6.1

@davidism
Copy link
Member

So what's your proposal? I don't want to drop the prefix, but converting arbitrary objects to string might not be correct.

@mcdallas
Copy link
Author

Maybe add a check to see if the attempted key is a string and only then add the prefix.

@davidism
Copy link
Member

How about if a prefix is defined, string keys are required, if it's none any key is allowed with the understanding that collisions are easier.

@mcdallas
Copy link
Author

That works too. I can send a PR this weekend.

@davidism
Copy link
Member

That would be really helpful, thanks!

mcdallas added a commit to mcdallas/werkzeug that referenced this issue Jul 22, 2017
Support for all keys when no key_prefix is given as per Issue pallets#1152
@davidism
Copy link
Member

The cache is deprecated, see #1249

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants