You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Binary (non-text) files aren't able to scanned properly, and that causes them to print exceptions to the terminal during a scan. It looks like this:
[seCureLI] [WARN] - An unknown error occurred loading the file from <file path>
Here are a couple examples of binary files that throw an exception when we attempt to read them with a utf-8 encoding (after I started logging the underlying exception):
tests/data/backends/test_backend-0.1-py2.py3-none-any.whl: 'utf-8' codec can't decode byte 0xd8 in position 17: invalid continuation byte
tests/data/packages3/dinner/Dinner-1.0.tar.gz: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
We should detect and exclude files that aren't utf-8.
The text was updated successfully, but these errors were encountered:
[secureli-374](#374)
<!-- Include general description here -->
Excludes binary files from scans.
## Changes
<!-- A detailed list of changes -->
* Added logic to skip binary files from scans
* Updated launch.json configs to avoid deprecated settings
## Testing
<!--
Mention updated tests and any manual testing performed.
Are aspects not yet tested or not easily testable?
Feel free to include screenshots if appropriate.
-->
* All existing tests passing, some updating required
* Added unit tests to test detection of binary files to be excluded
## Clean Code Checklist
<!-- This is here to support you. Some/most checkboxes may not apply to
your change -->
- [x] Meets acceptance criteria for issue
- [ ] New logic is covered with automated tests
- [x] Appropriate exception handling added
- [ ] Thoughtful logging included
- [ ] Documentation is updated
- [ ] Follow-up work is documented in TODOs
- [ ] TODOs have a ticket associated with them
- [x] No commented-out code included
<!--
Github-flavored markdown reference:
https://docs.github.com/en/get-started/writing-on-github
-->
Binary (non-text) files aren't able to scanned properly, and that causes them to print exceptions to the terminal during a scan. It looks like this:
Here are a couple examples of binary files that throw an exception when we attempt to read them with a utf-8 encoding (after I started logging the underlying exception):
We should detect and exclude files that aren't utf-8.
The text was updated successfully, but these errors were encountered: