Bug 638004 - [abrt] telepathy-butterfly-0.5.12-1.fc13: text.py:175:_signal_text_received:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Summary: [abrt] telepathy-butterfly-0.5.12-1.fc13: text.py:175:_signal_text_received:U...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: telepathy-butterfly
Version: 13
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Brian Pepple
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:f9e672c9
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-28 00:19 UTC by Stéphane Maniaci
Modified: 2011-06-28 12:15 UTC (History)
32 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-28 12:15:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.91 KB, text/plain)
2010-09-28 00:19 UTC, Stéphane Maniaci
no flags Details

Description Stéphane Maniaci 2010-09-28 00:19:04 UTC
abrt version: 1.1.13
architecture: i686
cmdline: /usr/bin/python /usr/libexec/telepathy-butterfly
comment: Speak french.
component: telepathy-butterfly
executable: /usr/libexec/telepathy-butterfly
kernel: 2.6.34.7-56.fc13.i686
package: telepathy-butterfly-0.5.12-1.fc13
reason: text.py:175:_signal_text_received:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
release: Fedora release 13 (Goddard)
time: 1285538704
uid: 500

backtrace
-----
text.py:175:_signal_text_received:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/papyon/switchboard_manager.py", line 387, in _sb_message_received
    handler._on_message_received(message)
  File "/usr/lib/python2.6/site-packages/papyon/conversation.py", line 362, in _on_message_received
    self._dispatch("on_conversation_message_received", sender, msg)
  File "/usr/lib/python2.6/site-packages/papyon/event/__init__.py", line 44, in _dispatch
    if event_handler._dispatch_event(name, *args):
  File "/usr/lib/python2.6/site-packages/papyon/event/__init__.py", line 65, in _dispatch_event
    handler(*params)
  File "/usr/lib/python2.6/site-packages/butterfly/channel/text.py", line 311, in on_conversation_message_received
    self._signal_text_received(id, timestamp, handle, type, 0, message.display_name, content)
  File "/usr/lib/python2.6/site-packages/butterfly/channel/text.py", line 175, in _signal_text_received
    headers[dbus.String('sender-nickname')] = dbus.String(sender_nick)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

Local variables in innermost frame:
sender: <butterfly.handle.ButterflyContactHandle object at 0x951b46c>
text: u"Aurais-tu la moindre id\xe9e de pourquoi je n'arrive pas \xe0 installer iTunes sur mon nouvel ordinateur?"
self: <butterfly.channel.im.ButterflyImChannel at /org/freedesktop/Telepathy/Connection/butterfly/msn/myaddress_40hotmail_2efr/TextChannel1 at 0x9325c2c>
sender_nick: 'M\xc3\xa9lissa (tu)'
headers: dbus.Dictionary({dbus.String(u'pending-message-id'): dbus.UInt32(0L), dbus.String(u'message-received'): dbus.UInt64(1285538704L), dbus.String(u'message-type'): dbus.UInt32(0L), dbus.String(u'message-sender'): dbus.UInt32(212L)}, signature=dbus.Signature('sv'))
flags: 0
timestamp: 1285538704
type: 0
id: 0

How to reproduce
-----
1. Some weird character produced it.
2.
3.

Comment 1 Stéphane Maniaci 2010-09-28 00:19:06 UTC
Created attachment 450063 [details]
File: backtrace

Comment 2 Andres Rios 2010-10-05 19:32:29 UTC
Package: telepathy-butterfly-0.5.14-1.fc13
Architecture: i686
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1.Just open it
2.
3.

Comment 3 John F 2010-10-06 18:08:58 UTC
Package: telepathy-butterfly-0.5.14-1.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. i think i was trying to connect to google talk and/or msn
2.
3.

Comment 4 sciamp 2010-10-08 12:51:42 UTC
Package: telepathy-butterfly-0.5.14-1.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. empathy was running
2. put my laptop to sleep
3. wake up
4. boom!

Comment 5 bugzilla-rd.100.bdelbass 2010-10-13 08:39:50 UTC
Package: telepathy-butterfly-0.5.14-1.fc13
Architecture: i686
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. Opened Telepathy, received a notification (spam) from a chinese friend, got this alert, but the program seems to work fine.
2.
3.

Comment
-----
Chinese input and display works fines in Telepathy, it's not clear why I got this message.

Comment 6 Iván Jiménez 2010-11-02 21:20:32 UTC
Package: telepathy-butterfly-0.5.14-1.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1.
2.
3.
a buddy send an im

Comment 7 niels 2010-11-08 14:08:05 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Applied latest 29 "automatic" updates.
2. Restarted when prompted.
3. After starting up I launched "Empathy Internet Messaging"

Comment 8 Yassine ABID 2010-11-13 11:47:50 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----

Comment 9 Danubio 2010-11-27 19:34:45 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.usando o messenger padrao
2.mudei para iniciar com status invisivel
3.apareceu o erro

Comment 10 gileade 2010-11-28 14:36:46 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.
2.
3.
l

Comment 11 John Vincent 2010-11-30 12:21:02 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. started tool
2. crashed immediately
3.

Comment 12 Kvikende 2010-12-01 15:43:08 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. It struggles with the email address my friend has.

Comment 13 Dagan McGregor 2010-12-04 01:45:19 UTC
Package: telepathy-butterfly-0.5.14-1.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. Login to MSN
2. User2 sends me a message
3. Crash reported


Comment
-----
I didn't do anything in this case, just recieved a message on MSN

Comment 14 Chen_Min_Chin 2010-12-16 09:24:57 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.I login empathy.
2.I got a offline message.
3.The bug occur.

Comment 15 Aaron 2010-12-18 04:34:04 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Started empathy
2. someone had sent me a message while I was offline
3.

Comment 16 Eric Alexander 2010-12-27 02:46:31 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.Al lanzar aplicacin
2.
3.

Comment 17 Eric Alexander 2011-01-02 01:21:00 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.Al lanzar aplicacion
2.
3.

Comment 18 ricardo.gladwell 2011-01-02 16:36:17 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
nothing

Comment 19 Eric Alexander 2011-01-04 18:52:43 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.Al lanzar aplicacion
2.
3.

Comment 20 Kvikende 2011-01-09 11:01:07 UTC
Has this been reported upstream? If not I probably can.

Comment 21 Yassine ABID 2011-01-18 12:16:28 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.
2.
3.
n

Comment 22 Joost 2011-01-20 22:32:08 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Sign in and receive and offline message
2.
3.

Comment 23 eduardovra 2011-02-01 11:41:47 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Crashed when using empathy
2.
3.

Comment 24 Kvikende 2011-02-06 09:59:44 UTC
I have reported this upstream:
https://bugs.freedesktop.org//show_bug.cgi?id=33959

Comment 25 Incog Nito 2011-03-01 11:20:26 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Logged on
2. recieved offline message
3. crash

Comment 26 François petrisot 2011-03-07 21:01:22 UTC
Package: telepathy-butterfly-0.5.14-1.fc13
Architecture: i686
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. receive a message in msn protocole
2.
3.

Comment 27 eduardovra 2011-03-09 13:09:36 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.opened emphaty
2.
3.

Comment 28 Miguel Angelo Mello 2011-03-11 12:50:15 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. When gnome startup.
2.
3.


Comment
-----
We should be able to disable some often happening crashes in the ABRT. Course ABRT can be deinstalled but in my case I would like to keep helping Fedora Development by reporting crashes.

Comment 29 Jean Gobin 2011-03-12 12:49:31 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----

I don't really know. I think a message was sent by one of my contacts when I was offline. At the time of reception, my contact was offline. To mention, when this occured, I was saturating my internet connection.

Looking at the trace, it seems the issue is related to decoding a nick that has unicode characters.

Comment
-----
i haven't tried to reproduce the issue.

Comment 30 Jean Gobin 2011-03-12 13:09:31 UTC
First: I don't know python very well. I apologize for possible mistakes.

A few more information. I think the bug is triggered when the received nick is
already unicode:

>>> s=unicode("hello")
>>> s
u'hello'
>>> t=unicode(s,"utf-8")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: decoding Unicode is not supported
>>> 

In "/usr/lib/python2.7/site-packages/butterfly/channel/text.py", lines 174 and
following, 

        if sender_nick not in (None, ''):
            sender_nick = unicode(sender_nick, "utf-8")
            headers[dbus.String('sender-nickname')] = dbus.String(sender_nick)

I think "sender_nick" type is never tested. Adding:

        if sender_nick not in (None, ''):
            if type(sender_nick).__class__ != 'unicode':
                   sender_nick = unicode(sender_nick, "utf-8")
            headers[dbus.String('sender-nickname')] = dbus.String(sender_nick)

Would possibly prevent this from happening.

Comment 31 Jean Gobin 2011-03-12 13:11:52 UTC
In my previous comment, I meant:

if sender_nick not in (None, ''):
            if type(sender_nick).__name__ != 'unicode':
                   sender_nick = unicode(sender_nick, "utf-8")
            headers[dbus.String('sender-nickname')] = dbus.String(sender_nick)

Comment 32 Kvikende 2011-03-13 11:43:53 UTC
Could you please try it for a while to see if that fixes it? If it does, please make a patch and get it upstream. I can help you with that if you like.

Comment 33 Jean Gobin 2011-03-13 13:00:37 UTC
Ok, just did the change and restarted Empathy. 


--- text.py.orig	2011-03-13 08:54:22.810980487 -0400
+++ text.py	2011-03-13 09:00:06.844803807 -0400
@@ -172,7 +172,9 @@
                   }, signature='sv')
 
         if sender_nick not in (None, ''):
-            sender_nick = unicode(sender_nick, "utf-8")
+	    # Test whether sender_nick is unicode. If so, no need to convert
+	    if type(sender_nick).__name__ != 'unicode':
+            	sender_nick = unicode(sender_nick, "utf-8")
             headers[dbus.String('sender-nickname')] = dbus.String(sender_nick)
 
         body = dbus.Dictionary({dbus.String('content-type'): dbus.String('text/plain'),

Comment 34 Jean Gobin 2011-03-13 22:28:53 UTC
I did the change, but still have the crash. Strangely, the line number hasn't change where my change should have pushed it one line down. 

I deleted the two text.pyc and text.pyo, and recreated them (import py_compile / py_compile.compile("text.py") with and without -O).

I just stopped Empathy, deleted text.pyc and text.pyo and restarted it. I'll let you know whether it works.

Comment 35 Kvikende 2011-03-20 14:48:17 UTC
That change will not work because the method uses the name "type" as a parameter so python will complain that you try to call an 'int' (it's like running " 2(i-will-crash) ").

I've made mine print the type name into a log file in hope to see if that will help. I think the issue is that the type isn't 'ascii' as the procedure unicode() expects.

Comment 36 Jean Gobin 2011-03-20 15:01:54 UTC
Possible. I haven't had a chance to work on this during the week.

Another way is to try...except:

...     try:
...             sender_nick=unicode(stringToConvert,"utf-8")
...     except:
...             # Do nothing, enjoy the weather
...             sender_nick=sender_nick

At this point my issue is that even with my previous change, I still have the crash (expected as per Kvikende's message), but the line number for the crash hasn't changed. 

Kvikende: I tried this in a python shell:

>>> unicodeString=unicode("hello there","utf-8")
>>> type(unicodeString)
<type 'unicode'>
>>> type(unicodeString).__name__
'unicode'

Could you comment?

Comment 37 Kvikende 2011-03-21 06:44:09 UTC
You have to remove text.pyc and text.pyo in the directory /usr/lib/python2.7/site-packages/butterfly/channel, and then regenerate them by running "python text.py && python -O text.py". The first one creates a .pyc and the latter creates an optimised .pyo.

Then restart Empathy (I logged in and out of GNOME to be extra sure).

A blog post trying to explain the error:
http://blog.codekills.net/archives/38-Encoding-and-Decoding-Text-in-Python-or-I-didnt-ask-you-to-use-the-ascii-codec!.html

Comment 38 Jean Gobin 2011-03-27 17:08:28 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----

I don't really know. I think a message was sent by one of my contacts when I was offline. At the time of reception, my contact was offline. To mention, when this occured, I was saturating my internet connection.

Looking at the trace, it seems the issue is related to decoding a nick that has unicode characters.

Comment
-----
Debugging the stuff. 

It reports the error at line 175 of the text.py, I'll change it to test the encoding of sender_nick first However, if there is another file to change, let me know.

Comment 39 Jean Gobin 2011-03-27 18:47:52 UTC
Back to this as I have some time.

I found a way to reproduce the issue. Basically, I created a second hotmail account, I gave it a name including non ascii characters (accents and so on).

Sending a message offline triggered the crash. 

The good part is my change (and recompiling all pyc/pyo) did the trick: no more crashes for the unicode reason, and I get the offline message just fine.

The bad part: I have a whole new crash! :D

ssl_socket.py:82:_io_channel_handler:Error: [('SSL routines', 'SSL23_READ', 'ssl handshake failure')]

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/papyon/gnet/io/ssl_socket.py", line 82, in _io_channel_handler
    buf = self._transport.recv(2048)
Error: [('SSL routines', 'SSL23_READ', 'ssl handshake failure')]

Local variables in innermost frame:
cond: 5
chan: <glib.IOChannel object at 0x18506f0>
buf: ''
self: <SSLTCPClient object at 0x1ad2960 (papyon+gnet+io+ssl_tcp+SSLTCPClient at 0x1ed7360)>

Comment 40 Ha ELRAI 2011-03-29 08:46:39 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. dont know the cause
2.
3.

Comment 41 Marcel 2011-04-03 15:21:30 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. nothing
2.
3.

Comment 42 Alexandru Cristian Zanogeanu 2011-04-06 06:45:36 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. login
2.
3.

Comment 43 fabian.vanderstuyft 2011-04-15 09:58:58 UTC
Package: telepathy-butterfly-0.5.14-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. just stated the client on an fresh reboot

Comment 44 Bug Zapper 2011-05-31 12:26:57 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  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 '13'.

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 13'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 13 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

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 45 Bug Zapper 2011-06-28 12:15:27 UTC
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 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.


Note You need to log in before you can comment on or make changes to this bug.