Bug 760047

Summary: [abrt] telepathy-butterfly-0.5.15-3.fc16: text.py:169:_signal_text_received:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range(128)
Product: [Fedora] Fedora Reporter: João Batista <jnfbatista>
Component: telepathy-butterflyAssignee: Brian Pepple <bdpepple>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: bdpepple, sander, simon.n.lindgren
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:e174e567a6aaf6c754aa9007c515d70a647cdb1e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-13 09:21:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: smolt_data none

Description João Batista 2011-12-05 11:09:03 UTC
libreport version: 2.0.7
abrt_version:   2.0.6
cmdline:        /usr/bin/python /usr/libexec/telepathy-butterfly
event_log:      2011-12-05-11:05:52> Smolt profile successfully saved
executable:     /usr/libexec/telepathy-butterfly
kernel:         3.1.2-1.fc16.x86_64
reason:         text.py:169:_signal_text_received:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range(128)
time:           Fri 02 Dec 2011 12:40:54 PM WET
uid:            1000
username:       batista

smolt_data:     Text file, 3175 bytes

backtrace:
:text.py:169:_signal_text_received:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range(128)
:
:Traceback (most recent call last):
:  File "/usr/lib/python2.7/site-packages/papyon/client.py", line 517, in event
:    self._dispatch(method_name, *args[:-1])
:  File "/usr/lib/python2.7/site-packages/papyon/event/__init__.py", line 44, in _dispatch
:    if event_handler._dispatch_event(name, *args):
:  File "/usr/lib/python2.7/site-packages/papyon/event/__init__.py", line 65, in _dispatch_event
:    handler(*params)
:  File "/usr/lib/python2.7/site-packages/butterfly/connection.py", line 480, in on_oim_messages_fetched
:    channel.offline_message_received(message)
:  File "/usr/lib/python2.7/site-packages/butterfly/channel/im.py", line 194, in offline_message_received
:    self._signal_text_received(id, timestamp, handle, type, 0, message.display_name, text)
:  File "/usr/lib/python2.7/site-packages/butterfly/channel/text.py", line 169, in _signal_text_received
:    dbus.String('content'): dbus.String(text)
:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range(128)
:
:Local variables in innermost frame:
:sender: <butterfly.handle.ButterflyContactHandle object at 0x31ec190>
:text: 'daqui a nada bazo para almo\xc3\xa7o'
:self: <butterfly.channel.im.ButterflyImChannel at /org/freedesktop/Telepathy/Connection/butterfly/msn/jnfbatista_40gmail_2ecom/TextChannel1 at 0x2faa950>
:sender_nick: u'paularguedes'
:headers: dbus.Dictionary({dbus.String(u'pending-message-id'): dbus.UInt32(0L), dbus.String(u'message-received'): dbus.UInt64(1322828667L), dbus.String(u'sender-nickname'): dbus.String(u'paularguedes'), dbus.String(u'message-type'): dbus.UInt32(0L), dbus.String(u'message-sender'): dbus.UInt32(15L)}, signature=dbus.Signature('sv'))
:flags: 0
:timestamp: 1322828667.0
:type: 0
:id: 0

Comment 1 João Batista 2011-12-05 11:09:06 UTC
Created attachment 540738 [details]
File: smolt_data

Comment 2 Simon Lindgren 2012-01-21 15:55:52 UTC
After brief testing, this fixes the problem:

In /usr/lib/python2.7/site-packages/papyon/service/OfflineIM/offline_messages_box.py, around lines 354-358 there is a snippet of code that looks like this:

    def __fetch_message_cb(self, id, run_id, sequence_num, text):
        message = self._messages.search_by_id(id)[0]
        message._run_id = run_id
        message._sequence_num = sequence_num
        message._text = text

Changing the last line to 
        message._text = unicode(text, 'utf8')

Fixes the problem for me.

I believe the bug is caused by the fact that offline messages are taking a different code path compared to normal messages. The code in text.py on line 169 assumes that the message is unicode, which it is in the online case. The code path for offline messages breaks this assumption. My change fixes this fairly close to the metal I believe, though I didn't put the effort in to dig deeper.

I've been having this issue on and off previously, so hopefully this can put an end to that.

Comment 3 Fedora End Of Life 2013-01-16 10:34:32 UTC
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

Comment 4 Fedora End Of Life 2013-02-13 09:21:13 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.