hiredis-py icon indicating copy to clipboard operation
hiredis-py copied to clipboard

TypeError: cannot pickle 'hiredis.Reader' object

Open PJ-Schulz opened this issue 4 years ago • 0 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?

PJ-Schulz avatar Jun 18 '21 11:06 PJ-Schulz