Bug 2220829 - config-manager plug-in doesn't work with system es_PE locale
Summary: config-manager plug-in doesn't work with system es_PE locale
Keywords:
Status: POST
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: dnf-plugins-core
Version: 9.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Pavla Kratochvilova
QA Contact: swm-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-06 07:45 UTC by Marc Muehlfeld
Modified: 2023-07-25 07:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-161662 0 None None None 2023-07-06 07:45:45 UTC

Description Marc Muehlfeld 2023-07-06 07:45:21 UTC
Description of problem:
When RHEL is configured to use the en_PE locale, the config-manager plug-in doesn't work. Additionally, each dnf command shows:
> Error al cargar el complemento "config_manager": '*prog'

> Translation: Error loading "config_manager" plugin: '*prog'.


Version-Release number of selected component (if applicable):
dnf-plugins-core-4.3.0-5.el9_2.noarch


How reproducible:
Always


Steps to Reproduce:
1. Install the langpacks-es.noarch package:
   # dnf install langpacks-es.noarch

2. Switch locale to en_PE:
   # localectl set-locale es_PE

3. Log out / Log in.

4. Run a dnf command that requires the config-manager plug-in:
   # dnf config-manager --enable codeready-builder-for-rhel-9-x86_64-rpm


Actual results:
Error al cargar el complemento "config_manager": '*prog'
...
Podr�a ser un comando del complemento DNF, intente: "dnf install 'dnf-command(config-manager)'"


Expected results:
dnf commands that require the config-manager plug-in should succeed. The error shouldn't be shown in every dnf command.


Additional info:
"dnf update" and "dnf install" work, but commands that require the config-manager plug-in fail.

Comment 1 Marc Muehlfeld 2023-07-06 07:54:09 UTC
This problem was identified in https://access.redhat.com/discussions/7020735

Comment 2 Petr Pisar 2023-07-24 15:05:53 UTC
A minimal reproducer:

# dnf install python3-dnf-plugins-core glibc-langpack-es
[...]
# LC_ALL=es_PE.UTF-8 dnf config-manager --dump
Error al cargar el complemento "config_manager": '*prog'
No existe el comando: config-manager. Por favor, utilice /usr/bin/dnf --help
Podría ser un comando del complemento DNF, intente: "dnf install 'dnf-command(config-manager)'"

python3-dnf-plugins-core-4.3.0-9.el9.noarch is also affected.

Comment 3 Petr Pisar 2023-07-24 15:17:27 UTC
/usr/share/locale/es/LC_MESSAGES/dnf-plugins-core.mo contains this suspicious translation:

msgid "manage {prog} configuration options and repositories"
msgstr "Dirige {*prog} opciones de configuración y repositorios"

/usr/lib/python3.9/site-packages/dnf-plugins/config_manager.py contains this Python code:

    summary = _('manage {prog} configuration options and repositories').format(
        prog=dnf.util.MAIN_PROG)

The spurious asterisk character triggers a Python exception when formatting the string:

$ python3 -c 'print("{prog}".format(prog="foo"))'
foo
$ python3 -c 'print("{*prog}".format(prog="foo"))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
KeyError: '*prog'

Which is interpreted by DNF as a failure when loading a plugin for config-manager subcommand.

The Spanish translation needs this fix:

 msgid "manage {prog} configuration options and repositories"
-msgstr "Dirige {*prog} opciones de configuración y repositorios"
+msgstr "Dirige {prog} opciones de configuración y repositorios"

Comment 4 Petr Pisar 2023-07-24 15:26:19 UTC
This issue has already been fixed in upstream commit <https://github.com/rpm-software-management/dnf-plugins-core/commit/3f6e34c47ec11b0572ded83f3c54a89c24b22c99>.


Note You need to log in before you can comment on or make changes to this bug.