This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 581670 - [abrt] crash in python-bugzilla-0.6.0-1.fc13: bugzilla:579:bug_field:UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 42: ordinal not in range(128)
[abrt] crash in python-bugzilla-0.6.0-1.fc13: bugzilla:579:bug_field:UnicodeE...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: python-bugzilla (Show other bugs)
13
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Will Woods
Fedora Extras Quality Assurance
abrt_hash:dcb4d404
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-12 18:12 EDT by Adam Williamson
Modified: 2010-04-22 18:35 EDT (History)
1 user (show)

See Also:
Fixed In Version: python-bugzilla-0.6.1-1.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-04-22 18:35:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
File: backtrace (828 bytes, text/plain)
2010-04-12 18:12 EDT, Adam Williamson
no flags Details
proposed patch for 'bugzilla' CLI (968 bytes, patch)
2010-04-13 10:28 EDT, Will Woods
no flags Details | Diff
proposed patch for 'bugzilla' CLI (1.10 KB, patch)
2010-04-14 10:57 EDT, Will Woods
no flags Details | Diff

  None (edit)
Description Adam Williamson 2010-04-12 18:12:02 EDT
abrt 1.0.9 detected a crash.

architecture: x86_64
cmdline: /usr/bin/python /usr/bin/bugzilla query '--outputformat=%{bug_id} %{bug_status} %{resolution} - %{short_desc}' -b 497785,505161,521432,522144,522182,522197,522318,522361,522398,522522,522540,522557,522575,522587,522601,522637,522645,522646,522647,522649,522688,522750,522786,522796,522842,522864,522932,522940,523190,523281,525405,532199,532243
comment: curl "http://fedoraproject.org/wiki/Test_Day:2009-09-10" | grep -o "bugzilla\.redhat\.com.*[=\/][0-9]\{6\}" | grep -v attach | grep -v class | sort -u | cut -d= -f 2 | tr '\n' ',' | sed 's|,$||' | xargs bugzilla query --outputformat="%{bug_id} %{bug_status} %{resolution} - %{short_desc}" -b > foo2
component: python-bugzilla
executable: /usr/bin/bugzilla
kernel: 2.6.33.2-38.fc13.x86_64
package: python-bugzilla-0.6.0-1.fc13
reason: bugzilla:579:bug_field:UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 42: ordinal not in range(128)
release: Fedora release 13 (Goddard)

backtrace
-----
bugzilla:579:bug_field:UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 42: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/bin/bugzilla", line 655, in <module>
    main()
  File "/usr/bin/bugzilla", line 581, in main
    print format_field_re.sub(bug_field,opt.outputformat)
  File "/usr/bin/bugzilla", line 579, in bug_field
    return str(getattr(b,fieldname))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 42: ordinal not in range(128)

Local variables in innermost frame:
matchobj: <_sre.SRE_Match object at 0x13c4140>
b: <Bug #522796 on https://bugzilla.redhat.com/xmlrpc.cgi at 0x13d6d10>
fieldname: 'short_desc'
special_fields: {'flag': <function <lambda> at 0x13cdcf8>, 'whiteboard': <function <lambda> at 0x13cdde8>}
rest: None
Comment 1 Adam Williamson 2010-04-12 18:12:05 EDT
Created attachment 406097 [details]
File: backtrace
Comment 2 Will Woods 2010-04-13 10:28:22 EDT
Created attachment 406263 [details]
proposed patch for 'bugzilla' CLI

Looks like the --outputformat code mishandles bug fields when they're unicode objects (which is the case for some bugs, e.g. bug 522796).

This patch should fix the problem - can you apply it to your bugzilla CLI:

  su -
  cd /usr/bin
  patch -p2 -b < /path/to/this.patch

(It'll probably apply with an offset of -23 lines but that's fine. Feel free to delete bugzilla.orig if it works.)
Comment 3 Adam Williamson 2010-04-13 13:18:01 EDT
Pseudo-applying that patch (I just hand-edited the file) results in a slightly different crash:

Package:    	python-bugzilla-0.6.0-1.fc13
Latest Crash:	Tue 13 Apr 2010 10:16:17 AM 
Command:    	/usr/bin/python /usr/bin/bugzilla query '--outputformat=%{bug_id} %{bug_status} %{resolution} - %{short_desc}' -b 497785,505161,521432,522144,522182,522197,522318,522361,522398,522522,522540,522557,522575,522587,522601,522637,522645,522646,522647,522649,522688,522750,522786,522796,522842,522864,522932,522940,523190,523281,525405,532199,532243
Reason:     	bugzilla:581:main:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)
Comment:    	None
Bug Reports:	

Line 581 in my copy is:

                print format_field_re.sub(bug_field,opt.outputformat)



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 4 Will Woods 2010-04-14 10:57:18 EDT
Created attachment 406541 [details]
proposed patch for 'bugzilla' CLI

Ah, yes. That patch was definitely not the right thing.

This one is slightly more sensible - can you confirm that it works for you?
Comment 5 Adam Williamson 2010-04-14 15:03:37 EDT
yup, looks good.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 6 Fedora Update System 2010-04-16 15:26:41 EDT
python-bugzilla-0.6.1-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/python-bugzilla-0.6.1-1.fc13
Comment 7 Fedora Update System 2010-04-20 09:29:38 EDT
python-bugzilla-0.6.1-1.fc13 has been pushed to the Fedora 13 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 python-bugzilla'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/python-bugzilla-0.6.1-1.fc13
Comment 8 Fedora Update System 2010-04-22 18:35:00 EDT
python-bugzilla-0.6.1-1.fc13 has been pushed to the Fedora 13 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.