RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1256845 - Exception in anaconda reclaim space dialog with "plural" languages
Summary: Exception in anaconda reclaim space dialog with "plural" languages
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Anaconda Maintenance Team
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-25 15:05 UTC by Vit Ry
Modified: 2015-08-25 17:20 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-25 17:20:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Anaconda exception stacktrace (305.36 KB, text/plain)
2015-08-25 15:05 UTC, Vit Ry
no flags Details
Patch to fix a bug (2.40 KB, patch)
2015-08-25 15:07 UTC, Vit Ry
no flags Details | Diff

Description Vit Ry 2015-08-25 15:05:53 UTC
Created attachment 1066898 [details]
Anaconda exception stacktrace

Description of problem:

Anaconda's Reclaim space dialog crashes, if user uses language which has >=3 nplurals (Czech, Polish, Latvian...). See http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html for full list.

Version-Release number of selected component (if applicable):
anaconda-19.31.123-1


How reproducible:
always


Steps to Reproduce:
1. Prepare virtual machine, so it already has some OS/installation and no free space.
2. Start in VM installation of RHEL 7.1/CentOS 7.1 (15.03) and select one of "problematic" languages (Czech, Polish, Latvian...).
3. Press "System-Installation destination". Then Done. Reclaim space dialog will appears.
4.Press "Reclaim space".

Actual results:
Python exception appears (see attachement)

Expected results:
Appearing of another dialog - "Reclaim disk space"

Additional info:

This bug was introduced by this commit: 
https://github.com/rhinstaller/anaconda/commit/24beb771a76df9b3059dcade862b47f6b772676d#diff-67c821c2c42c4c96a7ad07c5a772061e

see file pyanaconda/ui/gui/spokes/lib/resize.py line 228.
So, commit added next logic

text = P_("<b>%s disk; %s reclaimable space</b> (in filesystems)",
          "<b>%s disks; %s reclaimable space</b> (in filesystems)",
          escape_markup(nDisks)) % (escape_markup(nDisks),   escape_markup(size_str(totalReclaimable)))

which will fails, because P_() need args like (str, str, int), but third argument is "escape_markup(nDisks)", which will be string, so gettext.py fails.

It can be easy fixed (and already fixed in anaconda-20.1-1; can't find proper commit) like

diff --git a/anaconda/pyanaconda/ui/gui/spokes/lib/resize.py b/anaconda/pyanaconda/ui/gui/spokes/lib/resize.py
index c45147e..5744b44 100644
--- a/anaconda/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/anaconda/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -225,7 +225,7 @@ class ResizeDialog(GUIObject):
         if nDisks is not None and totalReclaimable is not None:
             text = P_("<b>%(count)s disk; %(size)s reclaimable space</b> (in file systems)",
                       "<b>%(count)s disks; %(size)s reclaimable space</b> (in file systems)",
-                      escape_markup(nDisks)) % {"count": escape_markup(nDisks),
+                      nDisks) % {"count": escape_markup(nDisks),
                                                 "size": escape_markup(totalReclaimable)}
             self._reclaimable_label.set_markup(text)

Comment 1 Vit Ry 2015-08-25 15:07:28 UTC
Created attachment 1066900 [details]
Patch to fix a bug

Comment 3 David Shea 2015-08-25 17:20:40 UTC
Thanks for the report. The change in your patch is already in git  (https://github.com/rhinstaller/anaconda/blob/rhel7-branch/pyanaconda/ui/gui/spokes/lib/resize.py#L231), so this bug will be fixed in the next version of RHEL 7.


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