Ubuntu 12.04.2 Menu-Libre not starting

Bug #1159375 reported by scuba
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MenuLibre
Fix Released
Critical
Sean Davis

Bug Description

Good morning,

I've seen the previous Bug concerning 13.04. The workaround suggested by Ryan in the previous report did not squash this bug for me on Ubuntu 12.04.2. This bug seems regressive. No change when executing as root. Menu-Libre will not start.

Error displayed in shell --

<email address hidden>:~$ /opt/extras.ubuntu.com/menulibre/bin/menulibre
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `Window' can't be set after construction
  Gtk.Window.__init__(self, type=type, **kwds)
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/menulibre/bin/menulibre", line 47, in <module>
    menulibre.main()
  File "/opt/extras.ubuntu.com/menulibre/menulibre/__init__.py", line 44, in main
    window = MenulibreWindow.MenulibreWindow()
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/Window.py", line 48, in __new__
    new_object.finish_initializing(builder)
  File "/opt/extras.ubuntu.com/menulibre/menulibre/MenulibreWindow.py", line 57, in finish_initializing
    self.apps = MenulibreXdg.get_applications()
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 199, in get_applications
    applications[filename] = Application(os.path.join(root, filename))
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 164, in __init__
    MenulibreDesktopEntry.__init__(self, filename)
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 38, in __init__
    self.load_properties(filename)
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 77, in load_properties
    self.load_properties_from_text(input_file.read())
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 91, in load_properties_from_text
    self.properties[current_property][key] = value
KeyError: ''

Great must-have tool for multi user systems, I guess its back to manual editing :-( for now?

Revision history for this message
Sean Davis (bluesabre) wrote :

Hello,

Could you try something for me to better diagnose the bug? Please modify /opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py as root and insert the following after line 90 (spaces included):

                print line
                print key
                print value

Then attempt to run it again and post the output. Thanks!

Revision history for this message
scuba (scubuntu) wrote : Re: [Bug 1159375] Re: Ubuntu 12.04.2 Mernu-Libre not starting
Download full text (4.2 KiB)

Hi Sean,

nope, stiil no start.

Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/menulibre/bin/menulibre", line 47, in <module>
    menulibre.main()
  File "/opt/extras.ubuntu.com/menulibre/menulibre/__init__.py", line
44, in main
    window = MenulibreWindow.MenulibreWindow()
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/Window.py",
line 48, in __new__
    new_object.finish_initializing(builder)
  File "/opt/extras.ubuntu.com/menulibre/menulibre/MenulibreWindow.py",
line 57, in finish_initializing
    self.apps = MenulibreXdg.get_applications()
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py",
line 202, in get_applications
    applications[filename] = Application(os.path.join(root, filename))
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py",
line 167, in __init__
    MenulibreDesktopEntry.__init__(self, filename)
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py",
line 38, in __init__
    self.load_properties(filename)
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py",
line 77, in load_properties
    self.load_properties_from_text(input_file.read())
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py",
line 94, in load_properties_from_text
    self.properties[current_property][key] = value
KeyError: ''

2013/3/24 Sean Davis <email address hidden>:
> Hello,
>
> Could you try something for me to better diagnose the bug? Please
> modify /opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py as
> root and insert the following after line 90 (spaces included):
>
> print line
> print key
> print value
>
> Then attempt to run it again and post the output. Thanks!
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1159375
>
> Title:
> Ubuntu 12.04.2 Mernu-Libre not starting
>
> Status in MenuLibre:
> New
>
> Bug description:
> Good morning,
>
> I've seen the previous Bug concerning 13.04. The workaround suggested
> by Ryan in the previous report did not squash this bug for me on
> Ubuntu 12.04.2. This bug seems regressive. No change when executing as
> root. Menu-Libre will not start.
>
> Error displayed in shell --
>
> <email address hidden>:~$ /opt/extras.ubuntu.com/menulibre/bin/menulibre
> /usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `Window' can't be set after construction
> Gtk.Window.__init__(self, type=type, **kwds)
> Traceback (most recent call last):
> File "/opt/extras.ubuntu.com/menulibre/bin/menulibre", line 47, in <module>
> menulibre.main()
> File "/opt/extras.ubuntu.com/menulibre/menulibre/__init__.py", line 44, in main
> window = MenulibreWindow.MenulibreWindow()
> File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/Window.py", line 48, in __new__
> new_object.finish_initializing(builder)
> File "/opt/extras.ubuntu.com/menulibre/menulibre/MenulibreWindow.py", line 57, in finish_initializing
> self.apps = MenulibreXdg.get_...

Read more...

Revision history for this message
scuba (scubuntu) wrote :

Hi Sean,

nope, I added the lines after line 90, no change --

Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/menulibre/bin/menulibre", line 47, in <module>
    menulibre.main()
  File "/opt/extras.ubuntu.com/menulibre/menulibre/__init__.py", line 44, in main
    window = MenulibreWindow.MenulibreWindow()
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/Window.py", line 48, in __new__
    new_object.finish_initializing(builder)
  File "/opt/extras.ubuntu.com/menulibre/menulibre/MenulibreWindow.py", line 57, in finish_initializing
    self.apps = MenulibreXdg.get_applications()
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 202, in get_applications
    applications[filename] = Application(os.path.join(root, filename))
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 167, in __init__
    MenulibreDesktopEntry.__init__(self, filename)
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 38, in __init__
    self.load_properties(filename)
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 77, in load_properties
    self.load_properties_from_text(input_file.read())
  File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line 94, in load_properties_from_text
    self.properties[current_property][key] = value
KeyError: ''

Revision history for this message
Sean Davis (bluesabre) wrote : Re: Ubuntu 12.04.2 Mernu-Libre not starting

I think I have fixed it now. If you're using the PPA, please update, otherwise, pull the latest version from bzr.

Let me know if the problem is resolved.

Thanks!

Revision history for this message
scuba (scubuntu) wrote : Re: [Bug 1159375] Re: Ubuntu 12.04.2 Mernu-Libre not starting

Hi Sean,

I updated via PPA, update was successful. Menu Libre still doesn't
start. Problem not resolved.

Output:

<email address hidden>:~$ /opt/extras.ubuntu.com/menulibre/bin/menulibre
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning:
g_object_set_property: construct property "type" for object `Window'
can't be set after construction
   Gtk.Window.__init__(self, type=type, **kwds)
Traceback (most recent call last):
   File "/opt/extras.ubuntu.com/menulibre/bin/menulibre", line 49, in
<module>
     menulibre.main()
   File "/opt/extras.ubuntu.com/menulibre/menulibre/__init__.py", line
44, in main
     window = MenulibreWindow.MenulibreWindow()
   File "/opt/extras.ubuntu.com/menulibre/menulibre_lib/Window.py", line
48, in __new__
     new_object.finish_initializing(builder)
   File "/opt/extras.ubuntu.com/menulibre/menulibre/MenulibreWindow.py",
line 92, in finish_initializing
     self.get_interface()
   File "/opt/extras.ubuntu.com/menulibre/menulibre/MenulibreWindow.py",
line 150, in get_interface
     self.initialize_appselection_iconview()
   File "/opt/extras.ubuntu.com/menulibre/menulibre/MenulibreWindow.py",
line 1389, in initialize_appselection_iconview
     apps.append([pixbuf, escape(app["Name"]), desktop_file,
app["Categories"], app["Comment"]])
   File
"/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line
54, in __getitem__
     return self.get_property('Desktop Entry', prop_name, default_locale)
   File
"/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line
103, in get_property
     prop = self.get_named_property(category, prop_name, locale_str)
   File
"/opt/extras.ubuntu.com/menulibre/menulibre_lib/MenulibreXdg.py", line
123, in get_named_property
     else: return str(entry.getComment())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in
position 4: ordinal not in range(128)

Am 24.03.2013 16:27, schrieb Sean Davis:
> I think I have fixed it now. If you're using the PPA, please update,
> otherwise, pull the latest version from bzr.
>
> Let me know if the problem is resolved.
>
> Thanks!
>

Revision history for this message
Zaphod (flerche) wrote :

Same thing here ...

summary: - Ubuntu 12.04.2 Mernu-Libre not starting
+ Ubuntu 12.04.2 Menu-Libre not starting
Revision history for this message
icb410 (ian-berke) wrote :

I'm getting this too. Just installed from ppa.

Package: menulibre 13.03.8 [origin: LP-PPA-menulibre-dev-devel]
PackageArchitecture: all
ProcVersionSignature: Ubuntu 3.5.0-26.42-generic 3.5.7.6
SourcePackage: menulibre
Tags: quantal running-unity third-party-packages
Title: menulibre crashed with UnicodeEncodeError in get_named_property(): 'ascii' codec can't encode character u'\xa0' in position 7: ordinal not in range(128)
Uname: Linux 3.5.0-26-generic x86_64

Revision history for this message
icb410 (ian-berke) wrote :

FYI, I think this is a bug in xdg itself, not returning the proper string if you have the wrong locale: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611923

I struggled with this for a while. Some .desktop files just won't work with xdg. I eventually gave up and am now using GMenu in my work.

I added the following line to the get_named_property() function (line110) and found the desktop file it was failing at:
        print self.filename, category, prop_name, locale_str

 The clustalx.desktop file is attached for your debugging use.

Revision history for this message
icb410 (ian-berke) wrote :

FYI, editing the Name property of the Desktop Entry in clustalx.desktop fixed it for me and menulibre opens now perfectly.

Revision history for this message
icb410 (ian-berke) wrote :

Try using encode(utf-8) instead of str():

 http://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20

Change lines 123 and 124 to:
                if prop_name == 'Name': return entry.getName().encode('utf-8')
                else: return entry.getComment().encode('utf-8')

Now it works with my clustalx.desktop file

Revision history for this message
Sean Davis (bluesabre) wrote :

Thanks for the suggestion, I have applied your fix and it is now available in the PPA. Please let me know if this resolves the problem.

Changed in menulibre:
status: New → Fix Committed
importance: Undecided → High
importance: High → Critical
assignee: nobody → Sean Davis (smd-seandavis)
Revision history for this message
Zaphod (flerche) wrote :

This works for me. Menulibre is starting and functional. Thx!

Revision history for this message
scuba (scubuntu) wrote :

Hi Sean,

thank you for this fix. I updated via PPA. Update was successful. Menu Libre is starting and functional. This problem is solved for me. No more manual editing... great stuff, thank you :-)

Sean Davis (bluesabre)
Changed in menulibre:
status: Fix Committed → Fix Released
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.