Misuse of quit() in api.py; Use of SystemExit(1) + narrow exception handling
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 50/100
Research direction
Start in face_recognition/api.py around lines 8-13, where face_recognition_models is imported and the broad exception handler prints installation instructions before calling quit(). Narrow the exception handling and replace the exit behavior as requested. Done when missing dependencies still show the stated installation message and the module exits with status 1 without masking unrelated import errors.
Written by the indexing model from the issue text.
Description
In face_recognition/api.py:
- The try/except block on lines 8-13 catches a broad Exception and then calls quit. Code below:
try:
import face_recognition_models
except Exception:
print("Please install face_recognition_models with this command before using face_recognition:\n")
print("pip install git+https://github.com/ageitgey/face_recognition_models")
quit()
Using ImportError instead of except Exception can prevent masking of unrelated errors, like syntax errors, that may happen during an import. Since the block calls an import and specifically checks for missing dependencies, use of ImportError is more focused on the codes specific purpose.
For the quit() --> SystemExit(1) suggestion, quit() isn't guaranteed to exist in all execution envs. Raising SystemExit(1) is more universal and serves the same purpose, preventing any disruption in existing code. SystemExit(1) also has the benefit of not needing an import to function.
- Dominant language
- Python
- Stars
- 56.8k
- Forks
- 13.7k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ageitgey/face_recognition
-
CLI image-folder regex missing end-anchor picks up non-image files (foo.jpg.bak, notes.jpegdoc)Possibly taken @Vic-41148 claimed this 64 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ageitgey/face_recognition#1678 ·
-
[Security] Automated static analysis findings for ageitgey/face_recognition (academic research)Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
ageitgey/face_recognition#1681 · 1 comment ·
-
Honest-FeedbackOpen
Difficulty 4/5 3-5 days Newbie friendliness 45/100
ageitgey/face_recognition#1669 · 3 comments ·
-
AiSoulOpen
Difficulty 5/5 Over a week Newbie friendliness 20/100
ageitgey/face_recognition#1668 · 1 comment ·
-
Logical Error: Image display (.show()) placed inside loop, causing multiple windows for multi-face imagesPossibly taken @pavansai018 claimed this 318 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 55/100
ageitgey/face_recognition#1666 ·
All issues in ageitgey/face_recognition
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
gramaziokohler/compas_timber#870 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
autowarefoundation/autoware_carla_scenario#500 ·
Maintainers usually reply within 1 day
-
good first issue priority: low size: XS testing
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
cubrid-lab/cubrid-mcp-server#385 ·
Maintainers usually reply within 1 day
-
good first issue priority: low size: S testing
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
cubrid-lab/cubrid-cookbook-python#447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100