redis / hiredis-py

Python wrapper for hiredis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: cannot pickle 'hiredis.Reader' object

PJ-Schulz opened this issue · comments

Hello,

I use hiredis in a pydantic BaseModel class and I get a TypeError when I run my script.

class RedisClient(BaseModel):
    reader: hiredis.Reader = hiredis.Reader(encoding="utf-8", errors="strict")
        
    class Config:
        arbitrary_types_allowed = True

This is the Exception:

TypeError: cannot pickle 'hiredis.Reader' object

can Anyone help?