RuntimeError: Bad magic number in .pyc file

Bug #422977 reported by abdullahc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gladex
New
Undecided
Unassigned

Bug Description

Hi,

I have installed 4.1 deb package of gladex.

It doesn't start at all from main menu. When I tried using terminal I got the following error msg:
RuntimeError: Bad magic number in .pyc file

========================
Distribution: Ubuntu 9.04 (jaunty)
Gnome Release: 2.26.1 2009-05-06 (Ubuntu)
BugBuddy Version: 2.26.0

System: Linux 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686
X Vendor: The X.Org Foundation
X Vendor Release: 10600000
Selinux: No
Accessibility: Disabled
GTK+ Theme: New Wave Dark Menus
Icon Theme: Tangerine
GTK+ Modules: canberra-gtk-module

Memory status: size: 0 vsize: 0 resident: 0 share: 0 rss: 0 rss_rlim: 0
CPU usage: start_time: 0 rtime: 0 utime: 0 stime: 0 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 0

----------- .xsession-errors (419 sec old) ---------------------
(trackerd:5158): GLib-GIO-CRITICAL **: g_file_hash: assertion `G_IS_FILE (file)' failed
** Message: ~totemPlugin [0xae682d0]
** Message: ~totemCone [0xcff8048]
** Message: NP_Shutdown
(trackerd:5158): GLib-GIO-CRITICAL **: g_file_hash: assertion `G_IS_FILE (file)' failed
(trackerd:5158): GLib-GIO-CRITICAL **: g_file_hash: assertion `G_IS_FILE (file)' failed
** (update-notifier:5174): DEBUG: /usr/lib/update-notifier/apt-check returned 8 (security: 8)
** (gnome-app-install:6429): WARNING **: return value of custom widget handler was not a GtkWidget
/usr/lib/python2.6/dist-packages/AppInstall/AppInstall.py:1295: GtkWarning: gtk_tree_model_sort_set_sort_column_id: assertion `tree_model_sort->default_sort_func != NULL' failed
  item.applications.set_sort_column_id(-1, sort_type)
RuntimeError: Bad magic number in .pyc file
RuntimeError: Bad magic number in .pyc file
--------------------------------------------------

Revision history for this message
Antonio Lucas (antonioluccas) wrote :

Hi, I had the same problem here with the .deb package.

A solution is download the source and just click on the gladex.py file.

If you are using python 2.5 it will work.

python 2.6 is not compatible with gladex, so pay attention to this.

when run in python 2.6 I have got this error:

(gladex.py:3665): libglade-WARNING **: could not find glade file '/gladex.glade'
Traceback (most recent call last):
  File "gladex.py", line 66, in <module>
    someclass = GladexClass()
  File "gladex.py", line 38, in __init__
    self.wTree = gtk.glade.XML(self.gladefile)
RuntimeError: could not create GladeXML object

and there is another error in callbacks.py:

__import__("plugins/"+inspect.getmodulename(plugs[i]+".py"))

this does not work anymore in python2.6

give this error.

ImportError: Import by filename is not supported.

I do not know if someone going to fix this, if you just want to use gladex for now :

download the source,

and run:

python2.5 gladex.py

or change the first line of gladex.py from:
#!/usr/bin/env python

to

#!/usr/bin/env python2.5

Revision history for this message
abdullahc (sneetsher) wrote :

Hi ALL,

Thank you so much Antonio! Your hint work well.

So, I have changed DIRECTLY the Main Menu Command from "gladex" to:

python2.5 /usr/share/gladex/gladex.pyc

This is easier, no need to download the source.

Have a nice time.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.