Repository navigation
fix: narrow exception in Content-Length header lookup from Exception to AttributeError - #3918
Quratulain-bilal wants to merge 3 commits into
Conversation
…to AttributeError Bare 'except Exception' would swallow MemoryError, RecursionError, etc. The only realistic failure from getheader() is AttributeError.
There was a problem hiding this comment.
Pull request overview
Narrows Content-Length lookup error handling to avoid swallowing critical exceptions.
Changes:
- Catches only
AttributeErrorfromgetheader().
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/workflows/_commands.py |
Narrows header lookup exception handling. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
|
This pull request has been automatically marked as stale because it has had no activity for 60 days. It will be closed in 30 days unless there is a substantive update. If you intend to continue, please describe the current status, address or acknowledge outstanding feedback, and confirm whether the branch can be updated and the change remains ready for review. A comment that only states that the pull request is "still relevant" does not provide enough context for maintainers. |
- test_attribute_error_from_getheader_is_caught: AttributeError from getheader() is caught and reading continues - test_runtime_error_from_getheader_propagates: RuntimeError now propagates (was swallowed by bare except Exception) Assisted-by: GitHub Copilot (autonomous)
…rrow-exception # Conflicts: # tests/test_workflows.py
| assert stat.S_IMODE(registry.registry_path.stat().st_mode) == 0o644 | ||
| assert not list(registry.workflows_dir.glob("*.tmp")) | ||
|
|
||
| def test_update_mixed_targets_does_not_claim_all_up_to_date(self, project_dir, monkeypatch): |
|
Please address Copilot feedback and test & lint errors |


Problem
Bare
except Exceptionwould swallowMemoryError,RecursionError, etc.Fix
Narrow to
AttributeErrorwhich is the only realistic failure fromgetheader().Testing
Verified Content-Length header is read correctly
Verified missing header is handled gracefully