Bug 832195

Summary: Yum fails to print an error message with a non-ascii filename
Product: [Fedora] Fedora Reporter: Göran Uddeborg <goeran>
Component: yumAssignee: Fedora Packaging Toolset Team <packaging-team>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: ffesti, maxamillion, packaging-team, tim.lauridsen, zpavlas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-09 07:12:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Göran Uddeborg 2012-06-14 19:50:15 UTC
Description of problem:
When running a yum which fails because another yum has a lock, I get a Python traceback rather than an error message explaining the problem.

Version-Release number of selected component (if applicable):
yum-3.4.3-23.fc17.noarch

How reproducible:
Every time.

Steps to Reproduce:
1. yum list & # Or something else that will lock for a while
2. LANG=sv_SE.utf8 yum info nettle
  
Actual results:
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 321, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 124, in main
    base.doLock()
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1976, in doLock
    msg = _('Existing lock %s: another copy is running as pid %s.') % (lockfile, oldpid)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128)
Exit 1


Expected results:
A message
  Existerande lås <someFile>: en annan kopia kör som pid <pid>
for some values of someFile and pid.

Additional info:
There are a couple of similar reports already, but most of them have been closed.  Since this still happens, I guess this is in some way different.

Comment 1 Zdeněk Pavlas 2012-06-15 10:26:07 UTC
Hi, I think you may have non-ascii characters in your userid.
Could you run this and post the result?  Thanks!

~$ python -c 'import os,pwd;print repr(pwd.getpwuid(os.geteuid())[0])'

Comment 2 Göran Uddeborg 2012-06-15 19:36:13 UTC
I do indeed; I use my first name as userid:

mimmi$ python -c 'import os,pwd;print repr(pwd.getpwuid(os.geteuid())[0])'
'g\xc3\xb6ran'

I'm surprised that fact related to the error I reported here.  The Swedish translation of

  Existing lock %s: another copy is running as pid %s.

is

  Existerande lås %s: en annan kopia kör som pid %s.

The fourteenth character is indeed non-ascii.  So I thought it was that string it failed to decode.

But when testing on another account, it does indeed work as expected.  I get the Swedish translation of the error message printed, and yum keeps waiting rather than crashing.

Comment 3 Fedora Update System 2012-06-25 08:31:43 UTC
yum-3.4.3-28.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/yum-3.4.3-28.fc17

Comment 4 Fedora Update System 2012-06-28 03:41:21 UTC
yum-3.4.3-28.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Göran Uddeborg 2012-07-02 16:05:09 UTC
The problem is gone in -28.

Is this bugzilla waiting for something more?  Most of the time I see bugzillas closed automatically when an updated goes from testing to stable.  But this update went directly to stable, and doesn't seem to have been automatically closed.

If it waits for me, I'm saying I'm happy with the fix! :-)

Comment 6 Zdeněk Pavlas 2012-07-09 07:12:13 UTC
Thanks, closing!