-
Notifications
You must be signed in to change notification settings - Fork 184
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
_memoize_version generates invalid keys #131
Comments
PR #132 |
|
Can you include the exception that you are receiving, as well as a failing unit test? The pull request proposed causes some of the existing unit tests to fail. |
The exception is:
If you switch to As far as the PR, I sort of expected it to break stuff. It was mostly to verify that part of the code was the thing generating the fault. I can research adding a failing test. |
Yeah, we need to figure out "why" you are getting invalid keys. The _memoize_make_cache_key function should be creating an MD5 for you already https://github.com/thadeusb/flask-cache/blob/master/flask_cache/__init__.py#L402 |
That one is easy.
|
What is the name of the function you are memoizing? |
I see now it is using the function namespace as-is without any translations |
If you could add a print statement or debug breakpoint to get the value of fetch_keys in the _memoize_version function would be super helpful. |
I've got a unit test for you... Just working on PR. It will only work if you use |
The issue is that some objects have a |
I will retract my earlier comment. Setting the pylibmc |
The function
_memoize_version
which is used within the@cache.memoize()
decorator can generate keys that are invalid for memcached.I am using
pylibmc==1.5.0
andFlask-Cache==0.13.1
I instantiate the
pylibmc
client with the behavior ofverify_keys
.The reason I do this is because when I switched to Python 3 the cache keys were breaking and verify keys seemed to fix it. As I look back on it now, maybe instead of fixing it it simply caused the errors to be hidden.
I see two potential issues:
Switching my client from
pylibmc
topython-memcached
it properly throws an exception for bad key errors coming from_memoize_version
.The text was updated successfully, but these errors were encountered: