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
[Bug]:【python】the data appears as garbled characters on Redis. #2260
Comments
Please make sure it's correct, thank you! |
hi @YmaYeah , can you please share an example of this data (but please remove all the sensitive information) |
luffy_api.zip |
|
@YmaYeah , can you please provide just an example of the data you see with garbled characters? it will be helpful to look at it in ASCII format |
okkkk, I write |
thank you, we need to look deeper into this, so it may take some time |
Hi there,
|
The problem I experience with this that results in the |
Hey @rad-pat, You are right with it. The library we currently use doesn't support Pickle Protocol 5. |
Protocol 5 will be supported in https://github.com/ewfian/pickleparser/pull/4/files |
a new version (with support for pickle protocol 5) is not available right now, it will be released with 2.36 in 1-2 weeks. |
available with 2.36 (released today) |
Preconditions (Any important steps we need to know)
1.【not sure】pip install django-redis
2.【must be】Configurate file configuration(in file
settings
)CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"CONNECTION_POOL_KWARGS": {"max_connections": 100}
}
}
}
Steps to reproduce (How to reproduce what you found step by step)
1.[Configurate url]
urlpatterns = [path('redis_test/',RedisTestView.as_view())]
2.[Configurate view]
class RedisTestView(APIView):
def get(self,request):
cache.set('star',[1,2,3])
return ApiResponse()
3.[Test in Postman]
http://127.0.0.1:8000/api/v1/home/redis_test/
Actual behavior (A short description of what you found)
the data appears as garbled characters on Redis
key:":1:star" val:'����]�(K�K�K�e.'
Expected behavior (A short description of what you expected to find)
key:":1:star" val:"[1, 2, 3]"by pickle.loads
Screenshots (Paste or drag-and-drop a screenshot or a link to a recording)
Additional context (Operating system, version of RedisInsight, Redis database version, Redis module version, database type, connection type, logs, or any other information)
Operating system:macOS Ventura 13.0
version of RedisInsight:2.26.0
Redis database version:7.0.11 (bottled), HEAD
Redis module version:redis 7.0.11_1
connection type:NoSQL
version of Django:3.2.12
version of django-redis:5.3.0
The text was updated successfully, but these errors were encountered: