Skip to content

plistlib: fix TypeError when parsing partial ISO 8601 dates (gh-151221)#151285

Closed
walsoup wants to merge 2 commits into
python:mainfrom
walsoup:plistlib-fix-issue-151221
Closed

plistlib: fix TypeError when parsing partial ISO 8601 dates (gh-151221)#151285
walsoup wants to merge 2 commits into
python:mainfrom
walsoup:plistlib-fix-issue-151221

Conversation

@walsoup

@walsoup walsoup commented Jun 10, 2026

Copy link
Copy Markdown

Fixes issue #151221: plistlib._date_from_string() was raising a confusing TypeError for partial ISO 8601 dates (e.g., '2024-06Z') because it broke early on missing components. The fix fills missing components with sensible defaults: month/day → 1, hour/minute/second → 0.

@python-cla-bot

python-cla-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Jun 10, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@walsoup walsoup changed the title plistlib: fix TypeError when parsing partial ISO 8601 dates plistlib: fix TypeError when parsing partial ISO 8601 dates fix issue #151221 Jun 10, 2026
@walsoup walsoup changed the title plistlib: fix TypeError when parsing partial ISO 8601 dates fix issue #151221 plistlib: fix TypeError when parsing partial ISO 8601 dates (bpo-151221) Jun 10, 2026
@walsoup walsoup changed the title plistlib: fix TypeError when parsing partial ISO 8601 dates (bpo-151221) plistlib: fix TypeError when parsing partial ISO 8601 dates (gh-151221) Jun 10, 2026
@StanFromIreland

Copy link
Copy Markdown
Member

Please don't open PRs when one is already open: #151217

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants