MSYS2-packages: The ``msgcat`` binary is broken

Description / Steps to reproduce the issue

msgcat -o file.po file.po command produces syntax errors in .po files.

Turns

#: library/stdtypes.rst:419 library/stdtypes.rst:1171
#: library/stdtypes.rst:2397 library/stdtypes.rst:3615
msgid "\\(4)"
msgstr "\\(4)"

to

#: library/stdtypes.rst:419 library/stdtypes.rst:1171
#: library/stdtypes.rst:2397
 library/stdtypes.rst:3615
msgid "\\(4)"
msgstr "\\(4)"

which is syntactically wrong. However, on some files, it does keep it the correct way. The above example is from python/python-docs-tr (library/stdtypes.po).

It also adds whitespace at the top of the first msgid-msgstr pair.

# Python Documentation Turkish Translation
# Copyright (C) 2001-2023, Python Software Foundation
# This file is distributed under the same license as the Python package.
-#
+# 
msgid ""
msgstr ""

Using other binaries, however, doesn’t produce any of these errors.

Expected behavior

Wraping the .po file without messing it up.

Actual behavior

Messing up the file causing syntax errors.

Verification

Windows Version

MSYS_NT-10.0-22621

Are you willing to submit a PR?

I don’t think I can

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

Does it change the line ending?

Correct. In your provided link, I see some ^M strings. Generally, those ^M strings can be seen when a file contains CRLF line endings. For example, here is a sample text file,

  • With CRLF:
$ cat -v test.txt
1st line^M
2nd line^M
  • With LF:
$ cat -v test.txt
1st line
2nd line