Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's no proper handling for not YAML formatted floorplan files #3

Open
Victoremepunto opened this issue Oct 15, 2021 · 2 comments
Open

Comments

@Victoremepunto
Copy link
Collaborator

The parser tries to open it as a yaml, reading lines expecting having the right format, which is not safe, this raises exceptions when the format is not the expected:

 ERROR    root:floorist.py:55 string indices must be integers
 Traceback (most recent call last):
   File "/opt/app-root/lib64/python3.9/site-packages/floorist/floorist.py", line 34, in main
     logging.debug(f"Dumping #{dump_count}: {row['query']} to {row['prefix']}")
 TypeError: string indices must be integers

This is reproducible just by passing a file with a random string as a content ( empty files also causes #2 )

Victoremepunto referenced this issue in Victoremepunto/floorist Oct 15, 2021
- Adds the pr_check.sh for running the project required validation checks.
- Adds the test.sh script which contains logic to set up and run integration tests
- Update docker-compose to use Quay repository images
- Updates Dockerfile to add multi-stage builds
- adds build-deploy logic to generate images
- Adds tests to cover #2 and #3
Victoremepunto referenced this issue in Victoremepunto/floorist Oct 15, 2021
- Adds the pr_check.sh for running the project required validation checks.
- Adds the test.sh script which contains logic to set up and run integration tests
- Update docker-compose to use Quay repository images
- Updates Dockerfile to add multi-stage builds
- adds build-deploy logic to generate images
- Adds tests to cover #2 and #3
@skateman
Copy link
Member

What kind of error would you like to see here? What's the right behavior?

@Victoremepunto
Copy link
Collaborator Author

@skateman I would expect the parser to check if the file is a well formatter YAML file, I guess there must be a way to parse the YAML to check the syntax, so we validate it before we start reading it.

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

No branches or pull requests

2 participants