Bug 1273844 - Unicode error on "dnf info" in C locale
Unicode error on "dnf info" in C locale
Status: CLOSED DUPLICATE of bug 1295090
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
: EasyFix, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-21 07:44 EDT by Stephen Tweedie
Modified: 2016-08-01 06:23 EDT (History)
6 users (show)

See Also:
Fixed In Version: dnf-1.1.9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-01 06:23:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen Tweedie 2015-10-21 07:44:18 EDT
Description of problem:
"dnf info Agda" fails with a Unicode traceback when run in C locale.

Version-Release number of selected component (if applicable):
dnf-1.1.3-1.fc23.noarch

How reproducible:
100%

Steps to Reproduce:
1. LANG=C dnf info Agda

Actual results:
Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 198, in user_main
    errcode = main(args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 136, in _main
    cli.run()
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 1091, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python3.4/site-packages/dnf/cli/commands/__init__.py", line 258, in run
    return self.base.output_packages('info', pkgnarrow, patterns)
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 435, in output_packages
    '=' : clar, 'not in' : clai})
  File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 606, in listPkgs
    self.infoOutput(pkg, highlight=highlight)
  File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 502, in infoOutput
    print_key_val_fill(_("Description"), pkg.description)
  File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 462, in print_key_val_fill
    " : ", val or ""))
  File "/usr/lib/python3.4/site-packages/dnf/i18n.py", line 44, in write
    self.stream.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 727: ordinal not in range(128)


Expected results:
No crash.

Additional info:
Fails both on a f23 host and in an f23 docker container.  Both environments fully updated with fedora-updates-testing.

The error is locale-dependent ---

$ LANG=C dnf info Agda
fails with the error above; but
$ LANG=en_GB.UTF-8 dnf info Agda
succeeds on the same system.
Comment 1 Fedora Admin XMLRPC Client 2016-07-08 05:35:15 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 2 Štěpán Smetana 2016-08-01 06:23:30 EDT
Works for me.
Should be fixed in dnf-1.1.9 (Take a look at this commit https://github.com/rpm-software-management/dnf/commit/93159e360f0b6150e598bba783e22ca113201a40)
In case reopen this bug and provide more info.
Thanks

*** This bug has been marked as a duplicate of bug 1295090 ***

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