Bug 1273844 - Unicode error on "dnf info" in C locale
Summary: Unicode error on "dnf info" in C locale
Keywords:
Status: CLOSED DUPLICATE of bug 1295090
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-21 11:44 UTC by Stephen Tweedie
Modified: 2016-08-01 10:23 UTC (History)
6 users (show)

Fixed In Version: dnf-1.1.9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-01 10:23:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Stephen Tweedie 2015-10-21 11:44:18 UTC
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 09:35:15 UTC
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 10:23:30 UTC
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.