Bug 783912
Summary: | UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 44: ordinal not in range(128) | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Kamil Páral <kparal> |
Component: | rpmlint | Assignee: | Tom "spot" Callaway <tcallawa> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 16 | CC: | a.badger, manuel.wolfshant, tcallawa, tmz, ville.skytta |
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: | 2013-01-17 11:08:57 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
Kamil Páral
2012-01-23 08:35:57 UTC
Here's the relevant line in the output: autofs.i686: W: summary-not-capitalized tr autofs sunucu süreci And here's an explanation of the problem: http://packages.python.org/kitchen/unicode-frustrations.html#frustration-3-inconsistent-treatment-of-output python uses the locale settings when it prints to a terminal but it ignores the locale settings when it prints to a file. Let me see if I can come up with something to fix this... note that I probably can't fix it globally unless rpmlint upstream is willing to grow a kitchen dependency and use kitchen.text.converters.getwriter(). Ah -- So this is actually simpler than the problem I was quoting. What's really happening is that the function in Filter.py is only capable of handling unicode strings correctly. When handed a byte str, it breaks. if sys.stdout.isatty(): def __print(s): print(s) else: def __print(s): print(s.encode(locale.getpreferredencoding(), "replace")) When we redirect to a file, we attempt to call the .encode() method of "s". If s is a unicode string then this works fine. If s is a byte str, then python first has to turn the byte str into a unicode string. Then it can call the .encode() method on that to turn it back into a byte str. It's when python is turning the byte str into a unicode string that python uses the ASCII codec and throws the exception. Here's the minimally invasive fix: if sys.stdout.isatty(): def __print(s): print(s) else: def __print(s): if isinstance(s, unicode): s = s.encode(locale.getpreferredencoding(), "replace") print(s) Reported upstream and built for rawhide. http://rpmlint.zarb.org/cgi-bin/trac.cgi/ticket/308 http://koji.fedoraproject.org/koji/taskinfo?taskID=3726180 spot and Ville, if this looks good to you feel free to push it to older Fedora releases as well. I can confirm that the new koji build fixes the problem. Fix looks fine to me, applied upstream but I'll leave updating the Fedora rpmlint package to others. This message is a reminder that Fedora 16 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 16. 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 '16'. 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 16'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 16 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, you are encouraged to click on "Clone This Bug" 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 Verified fixed in rpmlint-1.4-11.fc17.noarch. |