-
Notifications
You must be signed in to change notification settings - Fork 166
fix(secret): skip non-seekable files during scanning #1133
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
fix(secret): skip non-seekable files during scanning #1133
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1133 +/- ##
==========================================
- Coverage 91.96% 91.94% -0.02%
==========================================
Files 144 144
Lines 6174 6196 +22
==========================================
+ Hits 5678 5697 +19
- Misses 496 499 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b85664e to
92cc9f1
Compare
ggshield/core/scan/scannable.py
Outdated
| try: | ||
| byte_size = fp.seek(0, SEEK_END) | ||
| except OSError: | ||
| raise NonSeekableFileError("File does not support seeking operations") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the error message: it's never shown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Can you squash and merge?
9fbc396 to
5681156
Compare
Context
Ggshield crashes on scanning non-seekable files, to reproduce (only on linux):
Should return:
Explicitly skip them with a message:
