ITADN

Exception raised if the revision date is blank

#1219Opencdfarrow 创建于 2025-07-08
C
cdfarrowcommented
I created a .po file with [Poedit](https://poedit.net/) and it left the PO-Revision-Date field blank in the header. pybabel (2.17.0) raises the following exception when updating or compiling the po file: File "C:\<>\Python312\Lib\site-packages\babel\messages\catalog.py", line 102, in _parse_datetime_header dt = datetime.datetime.strptime(match.group('datetime'), '%Y-%m-%d %H:%M') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\<>\Python312\Lib\_strptime.py", line 554, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\<>\Python312\Lib\_strptime.py", line 333, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '' does not match format '%Y-%m-%d %H:%M' It would be nice to ignore the blank date, or at least, to give a graceful warning/error message.
0 条评论