babel icon indicating copy to clipboard operation
babel copied to clipboard

Handle blank PO-Revision-Date and POT-Creation-Date headers

Open bysiber opened this issue 9 months ago • 1 comments

When a PO file has a blank PO-Revision-Date header (e.g. generated by Poedit), _parse_datetime_header crashes with a ValueError because it tries to parse an empty string with strptime.

ValueError: time data '' does not match format '%Y-%m-%d %H:%M'

This adds a value.strip() check before calling _parse_datetime_header for both PO-Revision-Date and POT-Creation-Date headers. When the value is blank, the catalog keeps its existing defaults instead of crashing.

Fixes #1219

bysiber avatar Feb 21 '26 21:02 bysiber

See #1222 for previous discussion.

akx avatar Apr 10 '26 06:04 akx