Repository navigation
Fix multiple converter bugs: RSS crash, PPTX text loss, CSV pipes, Wikipedia regex, ExifTool encoding - #1723
Closed
Qiaochu Hu (hobostay) wants to merge 1 commit into
Closed
Qiaochu Hu (hobostay) wants to merge 1 commit into
Qiaochu Hu (hobostay) wants to merge 1 commit into
Conversation
…kipedia regex, ExifTool encoding 1. RSS: Initialize md_text before conditional to prevent NameError when channel has no title element 2. PPTX: Change elif to if for text frame extraction so shapes with both charts and text frames don't silently lose text content 3. CSV: Escape pipe characters in cell values to prevent malformed markdown tables 4. Wikipedia: Expand language subdomain regex to support hyphenated and multi-character codes (e.g., be-tarask, zh-classical, roa-rup) 5. ExifTool: Hardcode UTF-8 decoding since ExifTool always outputs UTF-8 JSON regardless of system locale Co-Authored-By: Claude Opus 4.6 <[email protected]>
Member
|
Thanks for the contribution. These look like legitimate fixed, but should be separated into separate focused PRs. Please also check the current main brain to verify the issues are still present. A number of them may have already been corrected in other PRs. |
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.
Summary
This PR fixes 5 bugs found across multiple converters:
RSS converter crash (
_rss_converter.py):NameErrorwhen an RSS feed has no<title>element in<channel>.md_textwas never initialized before the conditional assignment, causing a crash whenchannel_titleisNone. Fixed by initializingmd_text = ""and using+=consistently.PPTX text frame loss (
_pptx_converter.py):elif shape.has_text_frameafterif shape.has_chartcaused text content to be silently dropped for shapes that have both a chart and a text frame. Changedeliftoifso both chart and text content are extracted.CSV malformed tables (
_csv_converter.py): Pipe characters (|) in CSV cell values were not escaped, producing broken markdown tables with extra columns. Addedescape_pipe()helper to escape|as\|.Wikipedia language subdomain regex (
_wikipedia_converter.py): The regex[a-zA-Z]{2,3}rejected valid Wikipedia subdomains with hyphenated or multi-character language codes (e.g.,be-tarask,zh-classical,roa-rup,map-bms). Changed to[a-zA-Z0-9-]+to match all valid Wikipedia language subdomains.ExifTool encoding (
_exiftool.py): Usedlocale.getpreferredencoding(False)to decode ExifTool JSON output, which can fail on non-UTF-8 systems (e.g., Windows withcp1252). Since ExifTool always outputs UTF-8 JSON, hardcoded"utf-8"and removed unusedlocaleimport.Test plan
test_bug_fixes.pycovering:🤖 Generated with Claude Code