babel icon indicating copy to clipboard operation
babel copied to clipboard

Handle blank or malformed PO-Revision-Date in .po file headers

Open Aniketsy opened this issue 4 months ago • 4 comments

#1219 This PR fixes an issue where Babel would raise a valueError when encountering a blank or malformed field in .po file header.

Please provide feedback if my approach is not correct. I would love to improve and modify changes.

Thankyou!

Aniketsy avatar Jul 26 '25 19:07 Aniketsy

hi @akx

Please review this PR and provide feedback ! If this needs any changes to fix the issue.

Aniketsy avatar Jul 26 '25 19:07 Aniketsy

I don't know what's the best approach for blank dates but I don't think we should be silently ignoring malformed dates.

tomasr8 avatar Jul 27 '25 12:07 tomasr8

@tomasr8 Thankyou for the review . I would love to work on this and fix this issue .

Thanks again .

Aniketsy avatar Jul 28 '25 13:07 Aniketsy

Hi @Aniketsy, thank you for the contribution!

As Tomas also said, I don't think it's a great idea to simply ignore invalid dates and cause silent data loss.

This is somewhat similar to #1185, where "strange" plural templates would be handled differently. We may want to do something like that here too, i.e. that you could always access and manipulate the original string value if needed, and it would be passed through as-is, even when not parseable.

akx avatar Jul 29 '25 07:07 akx