diff --git a/Lib/test/test_tools/i18n_data/ascii-escapes.pot b/Lib/test/test_tools/i18n_data/ascii-escapes.pot index cc5a9f6ba619db..89ee65de23b211 100644 --- a/Lib/test/test_tools/i18n_data/ascii-escapes.pot +++ b/Lib/test/test_tools/i18n_data/ascii-escapes.pot @@ -12,7 +12,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: pygettext.py 1.5\n" +"Generated-By: pygettext.py 3.15\n" #. Special characters that are always escaped in the POT file diff --git a/Lib/test/test_tools/i18n_data/comments.pot b/Lib/test/test_tools/i18n_data/comments.pot index a1df46d453c546..babb69e46b44c9 100644 --- a/Lib/test/test_tools/i18n_data/comments.pot +++ b/Lib/test/test_tools/i18n_data/comments.pot @@ -12,7 +12,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: pygettext.py 1.5\n" +"Generated-By: pygettext.py 3.15\n" #: comments.py:4 diff --git a/Lib/test/test_tools/i18n_data/custom_keywords.pot b/Lib/test/test_tools/i18n_data/custom_keywords.pot index 03a9cba3a20b16..77c281f7264e6a 100644 --- a/Lib/test/test_tools/i18n_data/custom_keywords.pot +++ b/Lib/test/test_tools/i18n_data/custom_keywords.pot @@ -12,7 +12,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: pygettext.py 1.5\n" +"Generated-By: pygettext.py 3.15\n" #: custom_keywords.py:10 custom_keywords.py:11 diff --git a/Lib/test/test_tools/i18n_data/docstrings.pot b/Lib/test/test_tools/i18n_data/docstrings.pot index 387db2413a575f..73f349e15ad7e5 100644 --- a/Lib/test/test_tools/i18n_data/docstrings.pot +++ b/Lib/test/test_tools/i18n_data/docstrings.pot @@ -12,7 +12,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: pygettext.py 1.5\n" +"Generated-By: pygettext.py 3.15\n" #: docstrings.py:1 diff --git a/Lib/test/test_tools/i18n_data/escapes.pot b/Lib/test/test_tools/i18n_data/escapes.pot index 4dfac0f451ddcf..6db4c7f887df06 100644 --- a/Lib/test/test_tools/i18n_data/escapes.pot +++ b/Lib/test/test_tools/i18n_data/escapes.pot @@ -12,7 +12,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: pygettext.py 1.5\n" +"Generated-By: pygettext.py 3.15\n" #. Special characters that are always escaped in the POT file diff --git a/Lib/test/test_tools/i18n_data/fileloc.pot b/Lib/test/test_tools/i18n_data/fileloc.pot index dbd28687a73556..31e679b5701afd 100644 --- a/Lib/test/test_tools/i18n_data/fileloc.pot +++ b/Lib/test/test_tools/i18n_data/fileloc.pot @@ -12,7 +12,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: pygettext.py 1.5\n" +"Generated-By: pygettext.py 3.15\n" #: fileloc.py:5 fileloc.py:6 diff --git a/Lib/test/test_tools/i18n_data/messages.pot b/Lib/test/test_tools/i18n_data/messages.pot index e8167acfc0742b..e622cd0cc6df3e 100644 --- a/Lib/test/test_tools/i18n_data/messages.pot +++ b/Lib/test/test_tools/i18n_data/messages.pot @@ -12,7 +12,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: pygettext.py 1.5\n" +"Generated-By: pygettext.py 3.15\n" #: messages.py:16 diff --git a/Lib/test/test_tools/i18n_data/multiple_keywords.pot b/Lib/test/test_tools/i18n_data/multiple_keywords.pot index 954cb8e994838a..5b995adcd7c238 100644 --- a/Lib/test/test_tools/i18n_data/multiple_keywords.pot +++ b/Lib/test/test_tools/i18n_data/multiple_keywords.pot @@ -12,7 +12,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: pygettext.py 1.5\n" +"Generated-By: pygettext.py 3.15\n" #: multiple_keywords.py:3 diff --git a/Lib/test/test_tools/test_msgfmt.py b/Lib/test/test_tools/test_msgfmt.py index 7be606bbff606a..974fc9a5facbfa 100644 --- a/Lib/test/test_tools/test_msgfmt.py +++ b/Lib/test/test_tools/test_msgfmt.py @@ -253,7 +253,7 @@ def test_version(self): for option in ('--version', '-V'): res = assert_python_ok(msgfmt_py, option) out = res.out.decode('utf-8').strip() - self.assertEqual('msgfmt.py 1.2', out) + self.assertRegex(out, r'^msgfmt\.py \d+\.\d+$') def test_invalid_option(self): res = assert_python_failure(msgfmt_py, '--invalid-option') diff --git a/Misc/NEWS.d/next/Tools-Demos/2025-05-19-10-41-00.gh-issue-133319.asgss.rst b/Misc/NEWS.d/next/Tools-Demos/2025-05-19-10-41-00.gh-issue-133319.asgss.rst new file mode 100644 index 00000000000000..f56efb2195d24f --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2025-05-19-10-41-00.gh-issue-133319.asgss.rst @@ -0,0 +1 @@ +Use Python versioning in :program:`msgfmt` and :program:`pygettext`. diff --git a/Tools/i18n/msgfmt.py b/Tools/i18n/msgfmt.py index cd5f1ed9f3e268..efa2101649f25e 100755 --- a/Tools/i18n/msgfmt.py +++ b/Tools/i18n/msgfmt.py @@ -34,7 +34,7 @@ from email.parser import HeaderParser import codecs -__version__ = "1.2" +__version__ = "3.15" MESSAGES = {} diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py index f46b05067d7fde..5a86456c9c6058 100755 --- a/Tools/i18n/pygettext.py +++ b/Tools/i18n/pygettext.py @@ -152,7 +152,8 @@ from io import BytesIO from operator import itemgetter -__version__ = '1.5' +# Update this to the current python version when modifying this script. +__version__ = '3.15' # The normal pot-file header. msgmerge and Emacs's po-mode work better if it's @@ -387,7 +388,7 @@ def unparse_spec(name, spec): parts.append(f'{pos + 1}c') else: parts.append(str(pos + 1)) - return f'{name}:{','.join(parts)}' + return f'{name}:{",".join(parts)}' def process_keywords(keywords, *, no_default_keywords):