Bug 648215 - [abrt] gnome-activity-journal-0.5.0-1.fc13: lexer.py:146:get_tokens:TypeError: decode() argument 1 must be string, not None
Summary: [abrt] gnome-activity-journal-0.5.0-1.fc13: lexer.py:146:get_tokens:TypeError...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-activity-journal
Version: 13
Hardware: i686
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Mads Villadsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:56e0f091
: 704815 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-31 14:50 UTC by Sergey Raspopov
Modified: 2011-05-30 15:43 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-05-30 15:43:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.80 KB, text/plain)
2010-10-31 14:50 UTC, Sergey Raspopov
no flags Details

Description Sergey Raspopov 2010-10-31 14:50:41 UTC
abrt version: 1.1.13
architecture: i686
cmdline: python /usr/bin/gnome-activity-journal
component: gnome-activity-journal
executable: /usr/bin/gnome-activity-journal
kernel: 2.6.34.6-54.fc13.i686.PAE
package: gnome-activity-journal-0.5.0-1.fc13
reason: lexer.py:146:get_tokens:TypeError: decode() argument 1 must be string, not None
release: Fedora release 13 (Goddard)
time: 1288536603
uid: 500

backtrace
-----
lexer.py:146:get_tokens:TypeError: decode() argument 1 must be string, not None

Traceback (most recent call last):
  File "/usr/share/gnome-activity-journal/src/activity_widgets.py", line 574, in on_render
    pixbuf_w = self.pixbuf.get_width() if self.pixbuf else 0
  File "/usr/share/gnome-activity-journal/src/activity_widgets.py", line 541, in pixbuf
    return self.content_obj.thumbview_pixbuf
  File "/usr/share/gnome-activity-journal/src/content_objects.py", line 55, in __get__
    value = self.method(instance)
  File "/usr/share/gnome-activity-journal/src/content_objects.py", line 338, in thumbview_pixbuf
    thumbview_pixbuf, isthumb = common.PIXBUFCACHE.get_pixbuf_from_uri(self.uri, SIZE_LARGE, iconscale=0.1875, w=SIZE_THUMBVIEW[0], h=SIZE_THUMBVIEW[1])
  File "/usr/share/gnome-activity-journal/src/common.py", line 638, in get_pixbuf_from_uri
    pb = gfile.get_thumbnail(size=size)
  File "/usr/share/gnome-activity-journal/src/common.py", line 801, in get_thumbnail
    thumb = create_text_thumb(self, size, 1)
  File "/usr/share/gnome-activity-journal/src/common.py", line 495, in create_text_thumb
    content = highlight(content, lexer, formatter)
  File "/usr/lib/python2.6/site-packages/pygments/__init__.py", line 86, in highlight
    return format(lex(code, lexer), formatter, outfile)
  File "/usr/lib/python2.6/site-packages/pygments/__init__.py", line 45, in lex
    return lexer.get_tokens(code)
  File "/usr/lib/python2.6/site-packages/pygments/lexer.py", line 146, in get_tokens
    text = text.decode(enc['encoding'])
TypeError: decode() argument 1 must be string, not None

Local variables in innermost frame:
text: ''
self: <pygments.lexers.TextLexer>
enc: {'confidence': 0.0, 'encoding': None}
chardet: <module 'chardet' from '/usr/lib/python2.6/site-packages/chardet/__init__.pyc'>
unfiltered: False

Comment 1 Sergey Raspopov 2010-10-31 14:50:44 UTC
Created attachment 456723 [details]
File: backtrace

Comment 2 Thomas Canniot 2010-10-31 20:44:01 UTC
Package: gnome-activity-journal-0.5.0-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
This ABRT alet appeared when I clicked on the arrow to go to the yesterday view, when inside the ThumbView.

Comment 3 Michael 2011-02-12 07:03:25 UTC
Package: gnome-activity-journal-0.5.0-1.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. i start zeitgeist via gnome
2.
3.


Comment
-----
after a long periode whitout zeitgeist (mayby 5 days) i start zeitgeist. thats take a long - if i see my activity - then cames abrt

Comment 4 Martin Dengler 2011-04-27 16:01:00 UTC
Package: gnome-activity-journal-0.6.0-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
Happened when I wasn't touching anything; I had just:

1. Launched gnome-activity-journal
2. Scrolled "Today" panel down a bit
3. Waved the mouse pointer around a bit
4. ???
5. ABRT notification

Comment 5 Martin Dengler 2011-04-27 17:40:55 UTC
I forgot to note that the gnome-activity-journal GUI window remains responsive after I get the abrt.

I added some logging to the offending line in src/common.py in create_text_thumb(...) and found that GAJ was trying to highlight text in a binary file (actually a GPG-encrypted file, mime-type application/pgp-encrypted).

This patch resolved the issue for me:


$ diff -u ~/tmp/common.py /usr/share/gnome-activity-journal/src/common.py 
--- /home/martin/tmp/common.py  2011-04-28 01:38:09.568174004 +0800
+++ /usr/share/gnome-activity-journal/src/common.py     2011-04-28 01:31:50.524174000 +0800
@@ -502,7 +502,10 @@
     formatter = ImageFormatter(font_name="DejaVu Sans Mono", line_numbers=False, font_size=10)
     # to speed things up only highlight the first 20 lines
     content = "\n".join(gio_file.get_content().split("\n")[:20])
-    content = highlight(content, lexer, formatter)
+    try:
+        content = highlight(content, lexer, formatter)
+    except TypeError, msg:
+        return None
     thumb.write(content)
     thumb.flush()
     thumb.seek(0)


From the looks of the GAJ source code, this fix is already in upstream:

http://bazaar.launchpad.net/~gnome-zeitgeist/gnome-activity-journal/trunk/view/head:/src/common.py#L545

Comment 6 Bug Zapper 2011-05-30 14:28:23 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 7 Mads Villadsen 2011-05-30 15:41:00 UTC
*** Bug 704815 has been marked as a duplicate of this bug. ***

Comment 8 Mads Villadsen 2011-05-30 15:43:07 UTC
Thanks Martin. It does indeed look like it has been fixed upstream.

Closing this bug. Looks like it will be fixed in the next release.


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