Cache.REDIS: issubclass() arg 1 must be a class
- 主要言語
- Python
- スター
- 1.4k
- フォーク
- 181
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
In trying https://stackoverflow.com/questions/65686318/sharing-python-objects-across-multiple-workers I've encountered this exception.
Seems hit same issue here: https://github.com/samuelcolvin/pydantic/issues/545#issuecomment-595983173
From docker stderr:
```
app_1 | File "/app/./main.py", line 8, in
app_1 | cache = Cache(Cache.REDIS, endpoint="localhost", port=6379, namespace="main")
app_1 | File "/usr/local/lib/python3.8/site-packages/aiocache/factory.py", line 65, in __new__
app_1 | assert issubclass(cache_class, BaseCache)
app_1 | TypeError: issubclass() arg 1 must be a class
```
REPL:
```
>>> from aiocache import Cache
ujson module not found, using json
msgpack not installed, MsgPackSerializer unavailable
>>> Cache()
>>> Cache(Cache.REDIS)
Traceback (most recent call last):
File "", line 1, in
File "/Users/variant23/repos/mintad-validator/venv/lib/python3.8/site-packages/aiocache/factory.py", line 65, in __new__
assert issubclass(cache_class, BaseCache)
TypeError: issubclass() arg 1 must be a class
>>> type(Cache.REDIS)
>>> print(Cache.REDIS)
None
>>> print(Cache.MEMORY)
```
Packages:
```
aiocache==0.11.1
fastapi==0.65.1
pydantic==1.8.2
```
EDIT: Wasn't able to resolve the issue, ended up using `aioredis` instead.
コントリビューションガイド
評価
この issue はまだ評価されていません。