rpm-software-management / dnf-plugin-system-upgrade

A DNF plugin for system upgrades (moved to dnf-plugins-extras!)
GNU General Public License v2.0
24 stars 22 forks source link

UnicodeDecodeError on invalid argument options #47

Closed sedrubal closed 8 years ago

sedrubal commented 8 years ago

When executing dnf system-upgrade with an invalid argument option (e.g. dnf system-upgrade --foobar) dnf crashes with following TraceBack:

Traceback (most recent call last):
  File "/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 198, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 117, in _main
    cli.configure(map(ucd, args))
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1033, in configure
    self.command.configure(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/system_upgrade.py", line 414, in configure
    self.opts = self.parse_args(args)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/system_upgrade.py", line 379, in parse_args
    opts = self.parser.parse_args(extargs)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/system_upgrade.py", line 308, in parse_args
    self.print_help()
  File "/usr/lib64/python2.7/argparse.py", line 2340, in print_help
    self._print_message(self.format_help(), file)
  File "/usr/lib64/python2.7/argparse.py", line 2314, in format_help
    return formatter.format_help()
  File "/usr/lib64/python2.7/argparse.py", line 281, in format_help
    help = self._root_section.format_help()
  File "/usr/lib64/python2.7/argparse.py", line 212, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib64/python2.7/argparse.py", line 290, in _join_parts
    if part and part is not SUPPRESS])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 96: ordinal not in range(128)
sedrubal commented 8 years ago

Some info:

$> dnf --version
1.1.3
  Installiert: dnf-0:1.1.3-1.fc22.noarch am 2015-10-30 12:19                
  Erstellt   : Fedora Project am 2015-10-14 16:53                           

  Installiert: rpm-0:4.12.0.1-13.fc22.x86_64 am 2015-11-10 17:25            
  Erstellt   : Fedora Project am 2015-10-30 09:45
$> rpm -q dnf-plugin-system-upgrade
dnf-plugin-system-upgrade-0.7.0-1.fc22.noarch
wgwoods commented 8 years ago

Fairly certain this is the same problem as rhbz#1277895, which is fixed by commit 4bbbf1ec0c3f387249d30dd103ff4d002c17f574.