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

Fix IndexError when shebang is just '#!/usr/bin/env' #468

Merged

Conversation

harrymander
Copy link
Contributor

No description provided.

@asottile
Copy link
Member

is there an actual case where this came up? feels a bit like garbage-in-garbage-out

@harrymander
Copy link
Contributor Author

I did come across it randomly due to a typo in a file. I agree that it is a pretty unlikely scenario, though it seems to be the only case where the library raises an exception due to the contents of the file. I suppose it's not too hard for client code to just check for this edge case if it may be a problem

identify/identify.py Outdated Show resolved Hide resolved
@harrymander harrymander force-pushed the fix-index-error-with-env-shebang branch from 39c5d59 to 90c7a1e Compare July 1, 2024 20:35
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit 2e9f390 into pre-commit:main Jul 7, 2024
5 checks passed
@harrymander harrymander deleted the fix-index-error-with-env-shebang branch July 7, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants