Skip to content

Fix: safe access to applyNumberFormat attribute#312

Open
junstudys wants to merge 1 commit intodilshod:masterfrom
junstudys:fix/applyNumberFormat-safe-access
Open

Fix: safe access to applyNumberFormat attribute#312
junstudys wants to merge 1 commit intodilshod:masterfrom
junstudys:fix/applyNumberFormat-safe-access

Conversation

@junstudys
Copy link
Copy Markdown

Fix KeyError exception when directly accessing applyNumberFormat attribute at line 613 of xlsx2csv.py.

Problem: When applyNumberFormat attribute does not exist in cellXfs._attrs, using cellXfs._attrs['applyNumberFormat'] directly raises a KeyError.

Solution: Use cellXfs._attrs.get('applyNumberFormat', 0) for safe access, returning default value 0 when the attribute is missing.

Changes: xlsx2csv.py:613 — changed direct access to .get() safe access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant