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)
Summary: [abrt] crash in python-bugzilla-0.6.0-1.fc13: bugzilla:579:bug_field:UnicodeE...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-bugzilla
Version: 13
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Will Woods
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:dcb4d404
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-12 22:12 UTC by Adam Williamson
Modified: 2010-04-22 22:35 UTC (History)
1 user (show)

Fixed In Version: python-bugzilla-0.6.1-1.fc13
Clone Of:
Environment:
Last Closed: 2010-04-22 22:35:26 UTC
Type: ---
Embargoed:


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

Description Adam Williamson 2010-04-12 22:12:02 UTC
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 22:12:05 UTC
Created attachment 406097 [details]
File: backtrace

Comment 2 Will Woods 2010-04-13 14:28:22 UTC
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 17:18:01 UTC
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 14:57:18 UTC
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 19:03:37 UTC
yup, looks good.



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

Comment 6 Fedora Update System 2010-04-16 19:26:41 UTC
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 13:29:38 UTC
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 22:35:00 UTC
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.