Bug 574052

Summary: preupgrade-cli has encoding problems
Product: [Fedora] Fedora Reporter: Peter Hjalmarsson <kanelxake>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: dueno, fedora, ffesti, james.antill, johan.heikkila, jonas, maxamillion, nberrehouc, pmatilai, ppisar, richard, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-16 20:34:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Hjalmarsson 2010-03-16 13:46:15 UTC
Description of problem:
I have a Fedora 12 that is up to date.
I wanted to try out preupgrade-cli.

From "preupgrade-cli -h" you normally expect some sort of help:

# preupgrade-cli -h
/usr/lib/python2.6/site-packages/yum/__init__.py:210: UserWarning: Use .preconf instead of passing args to _getConfig
  warnings.warn('Use .preconf instead of passing args to _getConfig')
Inlästa insticksmoduler: blacklist, presto, refresh-packagekit, whiteout
Inlästa insticksmoduler: presto, refresh-packagekit
Traceback (most recent call last):
  File "/usr/share/preupgrade/preupgrade-cli.py", line 302, in <module>
    myrelease = pu.getconfig() # sets pu.opts
  File "/usr/share/preupgrade/preupgrade-cli.py", line 135, in getconfig
    opts = self.doUtilConfigSetup()
  File "/usr/share/yum-cli/utils.py", line 119, in doUtilConfigSetup
    (opts, self.cmds) = self._parser.setupYumConfig()
  File "/usr/share/yum-cli/cli.py", line 1155, in setupYumConfig
    (opts, cmds) = self.parse_args()
  File "/usr/lib/python2.6/optparse.py", line 1381, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1425, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1532, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib/python2.6/optparse.py", line 775, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.6/optparse.py", line 795, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/share/yum-cli/cli.py", line 1273, in _wrapOptParseUsage
    self.base.usage()
  File "/usr/share/yum-cli/cli.py", line 1044, in usage
    sys.stdout.write(self.optparser.format_help())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 703: ordinal not in range(128)

after running preupgrade-cli without arguments it tells me to try:

# preupgrade-cli 
/usr/lib/python2.6/site-packages/yum/__init__.py:210: UserWarning: Use .preconf instead of passing args to _getConfig
  warnings.warn('Use .preconf instead of passing args to _getConfig')
Inlästa insticksmoduler: blacklist, presto, refresh-packagekit, whiteout
Inlästa insticksmoduler: presto, refresh-packagekit
please give a release to try to pre-upgrade to
valid entries include:
   "Rawhide"
   "Fedora 13 (Branch)"

Here you can see the /usr/lib/python2.6/site-packages/yum/__init__.py:210 problem again.

But the real showstopper is:

# preupgrade-cli "Fedora 13 (Branch)"
/usr/lib/python2.6/site-packages/yum/__init__.py:210: UserWarning: Use .preconf instead of passing args to _getConfig
  warnings.warn('Use .preconf instead of passing args to _getConfig')
Inlästa insticksmoduler: blacklist, presto, refresh-packagekit, whiteout

<...>

zip.i686                                 3.0-1.fc13             preupgrade-main 
Total download size: 1.0GB
Download packages? 
Traceback (most recent call last):
  File "/usr/share/preupgrade/preupgrade-cli.py", line 312, in <module>
    pu.main(myrelease)
  File "/usr/share/preupgrade/preupgrade-cli.py", line 250, in main
    if not self.userconfirm():
  File "/usr/share/yum-cli/output.py", line 631, in userconfirm
    choice = raw_input(_('Is this ok [y/N]: '))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc4' in position 0: ordinal not in range(128)


preupgrade-cli does not survive that last thing.
preupgrade.noarch                  1.1.4-1.fc12

Comment 1 Dan Horák 2010-04-16 11:11:58 UTC
*** Bug 557434 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Admin XMLRPC Client 2010-04-16 14:34:44 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Daiki Ueno 2010-04-21 08:17:33 UTC
I think this is a bug of yum.  "preupgrade-cli -h" error should be fixed with the patch posted to #520773.

https://bugzilla.redhat.com/show_bug.cgi?id=520773

The following change (to /usr/share/yum-cli/output.py) is needed for the second error:

-    choice = raw_input(_('Is this ok [y/N]: '))
+    choice = raw_input(_('Is this ok [y/N]: ').encode(sys.stdout.encoding))

Comment 4 Petr Pisar 2010-05-31 13:45:22 UTC
This is duplicate of bug #539246. However feel free to close that because this report is advanced.

Comment 5 Richard Hughes 2010-07-13 11:19:16 UTC
*** Bug 539246 has been marked as a duplicate of this bug. ***

Comment 6 Jonas Jonsson 2010-11-03 08:32:26 UTC
Problem still exists in preupgrade-1.1.8-1.fc13.noarch.

Comment 7 Bug Zapper 2010-11-03 19:31:23 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Jonas Jonsson 2010-11-04 10:25:21 UTC
Problem still exists in preupgrade-1.1.8-1.fc13.noarch.

Comment 9 seth vidal 2010-11-04 16:54:16 UTC
Jonas,
 have you tested this in f14?

Comment 10 Jonas Jonsson 2010-11-04 17:30:43 UTC
Same problem on f14, preupgrade-1.1.8-1.fc14.noarch

Inlästa insticksmoduler: blacklist, whiteout
Ingen insticksmodul matchar: rpm-warm-cache
Ingen insticksmodul matchar: auto-update-debuginfo
Ingen insticksmodul matchar: presto
Inlästa insticksmoduler: refresh-packagekit, remove-with-leaves
Traceback (most recent call last):
  File "/usr/share/preupgrade/preupgrade-cli.py", line 317, in <module>
    release = pu.getconfig() # sets pu.opts
  File "/usr/share/preupgrade/preupgrade-cli.py", line 146, in getconfig
    opts = self.doUtilConfigSetup()
  File "/usr/share/yum-cli/utils.py", line 271, in doUtilConfigSetup
    (opts, self.cmds) = self._parser.setupYumConfig()
  File "/usr/share/yum-cli/cli.py", line 1304, in setupYumConfig
    (opts, cmds) = self.parse_args()
  File "/usr/lib64/python2.7/optparse.py", line 1394, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1434, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1509, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib64/python2.7/optparse.py", line 788, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib64/python2.7/optparse.py", line 808, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/share/yum-cli/cli.py", line 1425, in _wrapOptParseUsage
    self.base.usage()
  File "/usr/share/yum-cli/cli.py", line 1192, in usage
    sys.stdout.write(self.optparser.format_help())
  File "/usr/lib64/python2.7/optparse.py", line 1644, in format_help
    result.append(self.format_option_help(formatter))
  File "/usr/lib64/python2.7/optparse.py", line 1631, in format_option_help
    return "".join(result[:-1])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128)

Comment 11 Johan Heikkila 2012-06-21 13:04:34 UTC
Still a problem in F16, preupgrade-1.1.10-1.fc16

Traceback (most recent call last):
  File "/usr/share/preupgrade/preupgrade-cli.py", line 330, in <module>
    pu.main(release)
  File "/usr/share/preupgrade/preupgrade-cli.py", line 268, in main
    if not self.userconfirm():
  File "/usr/share/yum-cli/output.py", line 969, in userconfirm
    choice = raw_input(_('Is this ok [y/N]: '))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc4' in position 0: ordinal not in range(128)

This is on locale sv_FI. It works when setting LANG=C.

Comment 12 Nicolas Berrehouc 2012-07-27 20:18:11 UTC
Same bug with same message when trying upgrading from Fedora 16 to Fedora 17 with preupgrade-cli.

locale fr_FR.utf8 and preupgrade-1.1.10-1.fc16

Set LANG=C before works

Comment 13 Fedora End Of Life 2012-08-16 20:35:01 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping