Bug 2010676 - Escape sequence is printed instead of a non-breaking space in the Size column
Summary: Escape sequence is printed instead of a non-breaking space in the Size column
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: microdnf
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Rohel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-05 10:36 UTC by Viktor Ashirov
Modified: 2022-03-14 13:09 UTC (History)
5 users (show)

Fixed In Version: microdnf-3.8.1-1.fc37
Clone Of:
Environment:
Last Closed: 2022-03-14 13:09:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Viktor Ashirov 2021-10-05 10:36:32 UTC
Description of problem:

When microdnf is running in fedora-minimal container, that has POSIX locale by default, an escape sequence is printed instead of a non-breaking space in the Size column.
microdnf uses g_format_size(), that inserts non-breakable space.
From https://docs.gtk.org/glib/func.format_size.html
> The returned string is UTF-8, and may use a non-breaking space to separate the number and units, to ensure they aren’t separated when line wrapped.

If I change the locale to C.utf8 in the container, it works as expected.
Given that microdnf main purpose is to run in containers, specifically in fedora-minimal that defaults to POSIX locale, it would be good to produce human readable output by default.

Version-Release number of selected component (if applicable):
microdnf-3.8.0-2.fc35.x86_64

Steps to Reproduce:
1. podman run -ti fedora-minimal:35 
2. microdnf install vim

Actual results:
$ podman run -ti fedora-minimal:35 
bash-5.1# microdnf install vim 
Downloading metadata...
Downloading metadata...
Downloading metadata...
Downloading metadata...
Package                                                                    Repository                   Size
Installing:                                                                                                 
 gpm-libs-1.20.7-28.fc35.x86_64                                            fedora               20.5\xc2\xa0kB
 libsodium-1.0.18-8.fc35.x86_64                                            fedora               164.7\xc2\xa0kB
 vim-common-2:8.2.3404-1.fc35.x86_64                                       fedora               7.0\xc2\xa0MB
 vim-enhanced-2:8.2.3404-1.fc35.x86_64                                     fedora               1.9\xc2\xa0MB
 vim-filesystem-2:8.2.3404-1.fc35.noarch                                   fedora               22.4\xc2\xa0kB
 which-2.21-27.fc35.x86_64                                                 fedora               42.2\xc2\xa0kB
Transaction Summary:
 Installing:        6 packages
 Reinstalling:      0 packages
 Upgrading:         0 packages
 Obsoleting:        0 packages
 Removing:          0 packages
 Downgrading:       0 packages
Is this ok [y/N]: 

Expected results:
Size column should be human-readable.

Comment 1 Jaroslav Rohel 2021-10-21 13:25:57 UTC
I prepared a fix that will replace unbreakable spaces with simple spaces.
PR https://github.com/rpm-software-management/microdnf/pull/118

Comment 2 Fedora Update System 2022-03-14 13:07:10 UTC
FEDORA-2022-e119fcc7d5 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-e119fcc7d5

Comment 3 Fedora Update System 2022-03-14 13:09:39 UTC
FEDORA-2022-e119fcc7d5 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


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