Skip to content

Handle empty core-property date elements - #1623

Open
GreedyC wants to merge 1 commit into
python-openxml:masterfrom
GreedyC:codex/handle-empty-core-property-dates
Open

GreedyC wants to merge 1 commit into
python-openxml:masterfrom
GreedyC:codex/handle-empty-core-property-dates

Conversation

@GreedyC

@GreedyC GreedyC commented Oct 2, 2026

Copy link
Copy Markdown

Summary

Return None for empty core-property date elements, matching the existing behavior for absent elements and invalid date strings. Previously their None text reached the parser and raised TypeError.

Fixes #1622.

Tests

  • Added nine cases across created, modified, and last_printed: empty text, whitespace, and invalid date text. The three empty-element cases fail before the fix; all nine pass afterward.
  • Full unit suite: 1,618 passed on Python 3.12.
  • Behave acceptance suite: 650 scenarios / 1,856 steps passed.
  • Repository-wide Ruff lint and formatting of changed files pass (Ruff 0.11.13).

The tests use pytest 8.4.1 and pyparsing 3.2.3 (the latter matches the repository lock). Pyparsing 3.3.3 prevents collection because the existing test helpers use deprecated delimitedList; no dependency or unrelated helper changes are included here.

The optional strict Pyright check is not clean repository-wide: it reports 7,588 errors on both unmodified master and this branch, with none in either changed file. This is not reported as a passing type check.

AI assistance was used for this fix and tests.

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.

Empty core-property date elements raise TypeError instead of returning None

1 participant