Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

TypeError: load() missing 1 required positional argument: 'Loader' in database.py #128

Open
vishalchopra666 opened this issue Sep 17, 2023 · 1 comment

Comments

@vishalchopra666
Copy link

When I entered this command 'statik --watch', it throw the following error.

File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\statik\project.py", line 109, in generate
self.db = self.load_db_data(self.models)
File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\statik\project.py", line 212, in load_db_data
error_context=self.error_context
File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\statik\database.py", line 89, in init
self.create_db(models)
File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\statik\database.py", line 123, in create_db
self.load_all_model_data(models)
File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\statik\database.py", line 135, in load_all_model_data
self.load_model_data(model_data_path, model)
File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\statik\database.py", line 204, in load_model_data
self.load_model_data_collection(path, model)
File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\statik\database.py", line 216, in load_model_data_collection
collection = yaml.load(f.read())
TypeError: load() missing 1 required positional argument: 'Loader'

2023-09-17 22:43:32,859 statik.project ERROR Error: Failed to build project. Run Statik in verbose mode (-v) to see additional traceback information about this error. (in file "C:\Users\DELL\Desktop\website\statik-master\statik-master\examples\blog\data\Tag_all.yml"). Additional error detail: load() missing 1 required positional argument: 'Loader'

@vishalchopra666
Copy link
Author

Then, I edited the database.py under statik site_packages module, and I added the loader parameter collection = yaml.load(f.read(), Loader=yaml.Loader)

And then statik --watch worked without any error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant