Bug 520773 - [ja] /usr/share/yum-cli/callback.py: UnicodeEncodeError: 'ascii' codec can't encode characters
Summary: [ja] /usr/share/yum-cli/callback.py: UnicodeEncodeError: 'ascii' codec can't ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: livecd-tools
Version: 12
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Huff
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-02 10:25 UTC by Jens Petersen
Modified: 2014-01-21 23:11 UTC (History)
15 users (show)

Fixed In Version: livecd-tools-034-7.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-09-16 03:47:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to fix yum-cli Python unicode handling (2.77 KB, text/plain)
2010-04-21 01:27 UTC, Daiki Ueno
no flags Details

Description Jens Petersen 2009-09-02 10:25:15 UTC
Version-Release number of selected component (if applicable):
livecd-tools-026-1.fc12

Steps to Reproduce:
$ LANG=ja_JP.UTF-8 sudo /usr/bin/livecd-creator -c work/spin-kickstarts/HEAD/fedora-livecd-desktop.ks
  
Actual results:
Retrieving http://mirror/pub/fedora/linux/development/i386/os/Packages/zlib-1.2.3-23.fc12.i686.rpm ...OK
warning: fontpackages-filesystem-1.22-2.fc12.noarch: Header V3 RSA/SHA1 signature: NOKEY, key ID 57bbccba
Traceback (most recent call last):
  File "/usr/share/yum-cli/callback.py", line 196, in callback
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-12: ordinal not in range(128)
error: python callback <bound method RPMInstallCallback.callback of <callback.RPMInstallCallback instance at 0xb27c50c>> failed, aborting!

Expected results:
no backtrace

Additional info:
LANG=C continues ok to install the packages.

Comment 1 Bug Zapper 2009-11-16 11:54:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Juan P. Daza P. 2009-12-11 02:19:30 UTC
Thank you for taking the time to report this bug. Updates to this package have been released since it was first reported. If you have time to update the package and re-test, please do so and report the results here. You can obtain the updated package by typing 'yum update livecd-creator yum' or using the graphical updater, Software Update. 

---

Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 3 Jens Petersen 2010-01-29 06:42:55 UTC
Still happens with livecd-tools-031-1.fc12.1

Comment 4 Daiki Ueno 2010-04-21 01:26:21 UTC
/usr/share/yum-cli/*.py seem to have confusion handling Unicode in Python.  I'll attach a naive patch, which I confirmed fixing the original problem, though I think it might be better to use built-in print() instead of sys.stdout.write().

Comment 5 Daiki Ueno 2010-04-21 01:27:42 UTC
Created attachment 407956 [details]
patch to fix yum-cli Python unicode handling

Comment 6 Parag Nemade 2010-09-02 14:26:34 UTC
is there any progress here?

Comment 7 seth vidal 2010-09-02 15:11:40 UTC
Have you tried yum 3.2.28 from f12-updates?

Does it fix it ?

Comment 8 Jens Petersen 2010-09-03 04:41:25 UTC
No, still happen with yum-3.2.28-3.fc12.

Did you apply Ueno-san's above patch? :)

Comment 9 James Antill 2010-09-09 05:18:59 UTC
 Ueno-san, I assume you meant instead of:

-                            sys.stdout.write(msg)
+                            sys.stdout.write(msg.encode(sys.stdout.encoding))

...you suggest:

-                            sys.stdout.write(msg)
+                            print msg,

...if so then I'd happily accept/apply that patch.

Comment 10 Daiki Ueno 2010-09-09 10:08:10 UTC
(In reply to comment #9)
>  Ueno-san, I assume you meant instead of:
> 
> -                            sys.stdout.write(msg)
> +                            sys.stdout.write(msg.encode(sys.stdout.encoding))
> 
> ...you suggest:
> 
> -                            sys.stdout.write(msg)
> +                            print msg,
> 
> ...if so then I'd happily accept/apply that patch.

Yes, but sorry, I was totally missing the point.  livecd-tools should call yum.misc.setup_locale() before using any yum-cli module.  I've put an SRPM with the fix on:

http://ueno.fedorapeople.org/livecd-tools/livecd-tools-033-4.fc13.src.rpm

If it works, I think we can reassign this bug to livecd-tools.

Comment 11 Daiki Ueno 2010-09-10 03:51:57 UTC
Confirmed it by myself and reported to the livecd-tools upstream:
http://lists.fedoraproject.org/pipermail/livecd/2010-September/006234.html

Reassigning to livecd-tools.

Comment 12 Bruno Wolff III 2010-09-11 17:01:14 UTC
This patch (from comment 11) has been committed upstream.

Comment 13 Fedora Update System 2010-09-12 04:19:15 UTC
livecd-tools-034-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/livecd-tools-034-1.fc14

Comment 14 Jens Petersen 2010-09-13 02:13:59 UTC
Is it possible to have a backport for F13 too?

Comment 15 Bruno Wolff III 2010-09-13 02:52:47 UTC
Maybe. If 034 works well in F14, I'll probably try testing it an F13.
If there is some problem with testing in F13, then I am not sure whether or not I'll have time to work on selective backporting of patches.

First things need to work well in F14 though.

Comment 16 Fedora Update System 2010-09-13 18:09:00 UTC
livecd-tools-034-2.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update livecd-tools'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/livecd-tools-034-2.fc14

Comment 17 Fedora Update System 2010-09-15 03:22:00 UTC
livecd-tools-034-7.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/livecd-tools-034-7.fc14

Comment 18 Fedora Update System 2010-09-15 06:51:19 UTC
livecd-tools-034-7.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update livecd-tools'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/livecd-tools-034-7.fc14

Comment 19 Fedora Update System 2010-09-16 03:46:05 UTC
livecd-tools-034-7.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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