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

Use string values for django-cache keys #230 #242

Merged
merged 7 commits into from Oct 11, 2021

Conversation

badeendjuh
Copy link
Contributor

Fixes #230

When django cache backend tests the key provided by django_celery_results, It wants to have str type value.
byte values result in the following exception being raised:

File "/opt/exaboard/eXaboard/lib/python3.6/site-packages/django/core/cache/backends/base.py", line 287, in memcache_key_warnings
if ord(char) < 33 or ord(char) == 127:
TypeError: ord() expected string of length 1, but int found

badeendjuh and others added 3 commits October 11, 2021 14:52
When django cache backend tests the key provided by django_celery_results, It wants to have str type value. 
byte values result in the following exception being raised:

  File "/opt/exaboard/eXaboard/lib/python3.6/site-packages/django/core/cache/backends/base.py", line 287, in memcache_key_warnings
    if ord(char) < 33 or ord(char) == 127:
TypeError: ord() expected string of length 1, but int found
Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey the pr looks good. is it possible to update the related tests as well?

@badeendjuh
Copy link
Contributor Author

@auvipy , please have a look if the test added provides sufficient coverage

@auvipy auvipy merged commit 3b567d5 into celery:master Oct 11, 2021
@auvipy
Copy link
Member

auvipy commented Oct 11, 2021

thanks a lot for finding it out.

@badeendjuh badeendjuh deleted the patch-1 branch October 12, 2021 09:45
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.

CELERY_RESULT_BACKEND = 'django-cache' is not working when CELERY_CACHE_BACKEND='default' points to a Database
2 participants