Skip to content

Use Python versioning in msgfmt.py/pygettext.py #133319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
StanFromIreland opened this issue May 2, 2025 · 3 comments
Open

Use Python versioning in msgfmt.py/pygettext.py #133319

StanFromIreland opened this issue May 2, 2025 · 3 comments
Labels
triaged The issue has been accepted as valid by a triager. type-feature A feature request or enhancement

Comments

@StanFromIreland
Copy link
Contributor

StanFromIreland commented May 2, 2025

Feature or enhancement

Proposal:

Update these, which have not been touched for many years and are unnecessary:

__version__ = '1.5'

__version__ = "1.2"

To use CPython versioning instead.

I propose we have something like this instead:

"Generated-By: pygettext.py; Python X.XX\n"

cc @tomasr8

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

@StanFromIreland StanFromIreland added the type-feature A feature request or enhancement label May 2, 2025
@tomasr8 tomasr8 added the triaged The issue has been accepted as valid by a triager. label May 2, 2025
@sobolevn
Copy link
Member

sobolevn commented May 3, 2025

Is there anything wrong with the current version? Why do we need to change this? What if someone depends on the version number of gettext is some way?

@StanFromIreland
Copy link
Contributor Author

Is there anything wrong with the current version?

Not necessarily, but currently it is meaningless. A version number that was last updated 23 years ago does not serve much purpose, it is not helpful in differentiating the actual version of the tool.

Why do we need to change this?

It makes it useful, it actually informs the user about what version was used to generate it.

What if someone depends on the version number of [py]gettext is some way?

[Note: this issue is about the tools pygettext.py/msgmt.py and not Lib/gettext.py]

I do not see any realistic scenario where there would be a dependency on a version number, reiterating my previous points, it is useless in telling the version.

@tomasr8
Copy link
Member

tomasr8 commented May 3, 2025

(answering mainly for pygettext)

I think if we agree that we want to have a version number, it should be informative. pygettext has not been significantly touched in a long time up until recently so the current version number was somewhat accurate, but in 3.14 there will be lots of bug fixes and overall improvements. Keeping the same version seems rather unhelpful to anyone that might care about it.

At the same time, we don't want to keep a versioning scheme separate from the Python version since pygettext (and msgfmt) are distributed with it, so there would be no meaningful distinction.

Alternatively we could remove the version altogether but that puts the burden on the user to keep track of which python version was used to generate the POT file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged The issue has been accepted as valid by a triager. type-feature A feature request or enhancement
Projects
Status: No status
Development

No branches or pull requests

3 participants