Bug 261961
Summary: | Yum does not like non-ascii package names | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Nicolas Mailhot <nicolas.mailhot> | ||||||||||
Component: | yum | Assignee: | Jeremy Katz <katzj> | ||||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||
Severity: | low | Docs Contact: | |||||||||||
Priority: | medium | ||||||||||||
Version: | rawhide | CC: | a.badger, bruno, herrold, james.antill, pmatilai, tim.lauridsen | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | All | ||||||||||||
OS: | All | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | 3.2.16-2.fc9 | Doc Type: | Bug Fix | ||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2008-05-29 02:37:15 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: | |||||||||||||
Bug Depends On: | |||||||||||||
Bug Blocks: | 235704 | ||||||||||||
Attachments: |
|
Description
Nicolas Mailhot
2007-08-28 22:50:50 UTC
Created attachment 177681 [details]
iri to uri function from Django
Licensed under three clause, new style BSD.
Toshio, Is that license gpl compat? I don't want to look at the attachment unless it is. Understood. It is GPL 2 & 3 compatible according to: http://fedoraproject.org/wiki/Licensing BSD License (no advertising) aka 3 Clause BSD. Although reading the license again, the whole license text probably needs to be included at the top of the file if you use it: http://code.djangoproject.com/browser/django/trunk/LICENSE Created attachment 299034 [details]
Sample yum output plus rpm -qa output
This seemed to be the closest of three bugs with unicode and yum.
yum search is consistantly failing on my machine with the kitchen sink
installed which also happens to be x86_64 arch. This doesn't happen on either
of two other machines I am running up to date rawhide on. The other two
machines are x86 arch.
To my knowledge there are no packages with unicode names in Fedora right now. So this is probably the wrong bug. However there are multiple package with unicode descriptions or changelogs, which may trigger the bug you hit. Please open a separate ticket. OK, I'll do that. Bruno, please check https://bugzilla.redhat.com/show_bug.cgi?id=438633 your issue is fixed upstream I just took another look at this and the problem is not as bad as I thought at first. urlgrabber handles non-ASCII filenames fine, it's internationalized domain names where it needs help. The solution is to realize that urlgrabber doesn't understand how to deal with unicode which is understandable because it's providing you an interface to something with no explicit encoding. So it's dealing with things at the byte encoded level, not the abstract unicode level. Assuming that all filenames will be in utf-8 on the filesystem in question all you need to do is convert to utf-8 before passing the url to urlgrabber:: url = repourl + packagename type(url) <type 'unicode'> urlgrabber.urlgrab(url.encode('utf-8') What do you do if the remote server does not encode its filesystem filenames in utf-8? You fail. Unless you can query the server to find out what encoding the filenames are using, there's no way to make this translation. - urlgrabber.urlgrab(url.encode('utf-8') + urlgrabber.urlgrab(url.encode('utf-8')) Created attachment 304434 [details]
encode to utf-8 just before calling urlgrabber
Here's a patch against git HEAD to encode the url to utf-8 just before calling
urlgrabber. Tested on a file:// and http:// repo fine.
Also looked at the search problem in #4 and that seems to have been fixed in git HEAD by decoding the args and the database results to unicode strings before using them. Created attachment 304439 [details]
only convert unicode objects to utf8
So apparently, the sometimes hand off unicode objects to urlgrabber and
sometimes we hand off YumRepository objects.
This new patch creates a to_utf8() method like to_unicode() that only converts
if the object passed to it is unicode. Using it in _get_file() does the right
thing whether we are handing in a unicode or YumRepository.
Ok, that last patch looks fine. Applying. yum-3.2.16-1.fc9 has been submitted as an update for Fedora 9 yum-3.2.16-2.fc9 has been submitted as an update for Fedora 9 yum-3.2.16-2.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report. |