Skip to content

fix(issue #1219): Exception raised if the revision date is blank - #1334

Open
arunsoman wants to merge 1 commit into
python-babel:masterfrom
kannamma-labs:forge/fix-issue-1219
Open

fix(issue #1219): Exception raised if the revision date is blank#1334
arunsoman wants to merge 1 commit into
python-babel:masterfrom
kannamma-labs:forge/fix-issue-1219

Conversation

@arunsoman

Copy link
Copy Markdown

Fixes #1219

What

autonomous fix via atomic-forge fix — CIE (code graph over MCP) localized the bug, generated a failing regression test, and forge's repair loop fixed the source against it.

Issue

Exception raised if the revision date is blank

I created a .po file with Poedit 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.

How it was verified

  • regression test: tests/test_forge_1219.py (CIE-generated; fails on the pre-fix code, passes on the fix)
  • repair rounds: 1 failures: 2 -> 0
  • repaired file(s): babel/messages/catalog.py

🏛️ Generated end-to-end by atomic-forge — an autonomous, test-driven issue→PR repair engine (atomic-forge fix <issue-url>).

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.

Exception raised if the revision date is blank

1 participant