babel
babel copied to clipboard
Handle blank PO-Revision-Date and POT-Creation-Date headers
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
See #1222 for previous discussion.