Remove dead code handling missing dependencies#11627
Merged
cdrini merged 1 commit intointernetarchive:masterfrom Dec 25, 2025
Merged
Remove dead code handling missing dependencies#11627cdrini merged 1 commit intointernetarchive:masterfrom
cdrini merged 1 commit intointernetarchive:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes dead code that handled optional dependencies (genshi and BeautifulSoup) by converting conditional imports to direct imports, since these dependencies are always available in the project.
Key changes:
- Removed try-except blocks around genshi and BeautifulSoup imports, making them direct imports
- Removed the runtime check for genshi availability in the
sanitize()function - Refactored error handling to use recursive sanitization instead of nested try-except blocks
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e74747b to
ccd5f3d
Compare
RayBB
approved these changes
Dec 25, 2025
Collaborator
RayBB
left a comment
There was a problem hiding this comment.
The changes look right to me and if it works locally then I'd say we're good to go. But how do you test this?
Collaborator
Author
|
Sweet! Updated description with testing instructions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small refactor ; these dependencies are always available. Also make the code more robust and ensure sanitize always runs.
Technical
Testing
Tested adding XSS descriptions to book pages does not cause XSS and is sanitized.
Screenshot
Stakeholders