Repository navigation
fix: fall back when a declared charset is unknown - #192
Muneerali199 wants to merge 1 commit into
Conversation
bytes.decode raises LookupError (not UnicodeDecodeError) for an unrecognized charset label, bypassing the UTF-8/Latin-1 fallback. Catch it and use the normal fallback instead. Added a regression test. Fixes AOSSIE-Org#190 Signed-off-by: Muneerali199 <alimuneerali245@gmail.com>
|
No actionable comments were generated in the recent review. WalkthroughThe scraper now handles unrecognized response charset labels by continuing to its existing UTF-8 and Latin-1 fallback. A regression test checks the result for Latin-1 response bytes. ChangesUnknown Charset Fallback
Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested labels: Suggested reviewers: Merge Risk:
|
Fixes #190
bytes.decode()raisesLookupErrorfor an unknown charset label, so theUnicodeDecodeErrorfallback in_decodenever ran and the error escaped article extraction. Unknown charsets now fall through to the UTF-8 then Latin-1 decoding path. Added a regression test usingcharset=utf-8-bogus.Verification: the focused decode path was exercised locally; the full backend suite cannot run on this macOS x86_64 host because the locked
torchversion has no compatible wheel.Summary by CodeRabbit