-1
I’m trying to install and use Minio: https://github.com/minio/minio
, and installed the https://github.com/py-pa/django-minio-storage
for user as Storage in my djando project. But when saved an image is giving me the following error:
File "/home/developer/.virtualenvs/store/lib/python3.5/site-packages/django/core/files/storage.py", line 358, in get_storage_class
return import_string(import_path or settings.DEFAULT_FILE_STORAGE)
File "/home/developer/.virtualenvs/store/lib/python3.5/site-packages/django/utils/module_loading.py", line 17, in import_string
module = import_module(module_path)
File "/home/developer/.virtualenvs/store/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 661, in exec_module
File "<frozen importlib._bootstrap_external>", line 767, in get_code
File "<frozen importlib._bootstrap_external>", line 727, in source_to_code
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/developer/.virtualenvs/store/lib/python3.5/site-packages/minio_storage/storage.py", line 52
**kwargs,
^
SyntaxError: invalid syntax
Which is in that part of the code:
37 def __init__(
38 self,
39 minio_client: minio.Minio,
40 bucket_name: str,
41 *,
42 base_url: T.Optional[str] = None,
43 file_class=None,
44 auto_create_bucket: bool = False,
45 presign_urls: bool = False,
46 auto_create_policy: bool = False,
47 policy_type: T.Optional[Policy] = None,
48 object_metadata: T.Optional[T.Dict[str, str]] = None,
49 backup_format: T.Optional[str] = None,
50 backup_bucket: T.Optional[str] = None,
51 assume_bucket_exists: bool = False,
52 **kwargs,
53 ):
Then I removed the comma and the error stopped falling there, but it happened in other places:
raise OSError(f"The bucket {self.bucket_name} does not exist")
Here I removed the f before the string and stopped giving error.
But it began to give also in this line:
File "/home/developer/.virtualenvs/store/lib/python3.5/site-packages/minio_storage/storage.py", line 209
dirs: T.List[str] = []
I’ve never come across such mistakes, my python is in summer 3.5
and the compatibility of the library is Python 3.4-3.6
. Are these syntax errors real? And what to say this expression if it exists? dirs: T.List[str] = []