/usr/bin/krunner:TypeError:reloadConfiguration

Bug #1258088 reported by errors.ubuntu.com bug bridge
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kde-workspace (Ubuntu)
Fix Released
Low
Harald Sitter

Bug Description

The Ubuntu Error Tracker has been receiving reports about a problem regarding kde-workspace. This problem was most recently seen with version 4:4.11.3-0ubuntu0.1~ubuntu13.10~ppa1, the problem page at https://errors.ubuntu.com/problem/3b532e3ef8d46476f659e7c09d29376416fca181 contains more details.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Always the same unhelpful backtrace

Traceback (most recent call last):
  File "/usr/share/kde4/apps/plasma_scriptengine_python/pyrunner.py", line 90, in reloadConfiguration
    self.pyrunner.reloadConfiguration()
TypeError: reloadConfiguration() takes no arguments (1 given)

I do however suspect that there is a krunner or used to be a krunner written in python that according to our metrics is installed on quite some systems yet it is not in the package archive nor was I able to find any python runner that has the aforementioned issue.

Changed in kde-workspace (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Harald Sitter (apachelogger) wrote :

The following script will list all runners with python

for sDir in `kde4-config --path services | tr : '\n'`; do echo "checking $sDir"; for dFile in `grep -rl 'Plasma/Runner' /usr/share/kde4/services/`; do grep -ri python $dFile; done ; done

Revision history for this message
Harald Sitter (apachelogger) wrote :

So. This happens when a python runner does not implement all functions.

pyrunner itself has function calls like these

    def reloadConfiguration(self):
        self.pyrunner.reloadConfiguration()

which in turn lead to the traceback because reloadConfiguration is not actually a member of self.pyrunner (which is the instance of the runner plugin).

Revision history for this message
Harald Sitter (apachelogger) wrote :

Actually plamsascript (base of all python runner plugins) does not define the self keyword...

Revision history for this message
Harald Sitter (apachelogger) wrote : [kde-workspace/KDE/4.11] plasma/generic/scriptengines/python: Fix traceback in Python runner plugins

Git commit 8c5902e49b6387c3c2e82c475ff5a1f491da7604 by Harald Sitter.
Committed on 06/12/2013 at 09:11.
Pushed by sitter into branch 'KDE/4.11'.

Fix traceback in Python runner plugins

Plamascript.Runner is the base of python krunner plugins. These plugins
implement the C++ signals prepare, teardown, createRunOptions and
reloadConfiguration in actual methods (the signal wiring happens in
pyrunner.py which is the loading component). As a result of this calls
to any of these methods will fall through to plasmascript.Runner whenever
the actual runner does not implement them. However plasmascript.Runner is
missing the implicit 'self' argument such that one gets silly python
backtraces like

File "/usr/share/kde4/apps/plasma_scriptengine_python/pyrunner.py", line 90, in reloadConfiguration
    self.pyrunner.reloadConfiguration()

To prevent this from happening the functions now have the implicit self
argument.

Also see:
https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/1258088

CCMAIL: <email address hidden>
REVIEW: 114314

M +4 -4 plasma/generic/scriptengines/python/plasmascript.py

http://commits.kde.org/kde-workspace/8c5902e49b6387c3c2e82c475ff5a1f491da7604

diff --git a/plasma/generic/scriptengines/python/plasmascript.py b/plasma/generic/scriptengines/python/plasmascript.py
index 0ec38eb..ba149cf 100644
--- a/plasma/generic/scriptengines/python/plasmascript.py
+++ b/plasma/generic/scriptengines/python/plasmascript.py
@@ -212,14 +212,14 @@ class Runner(QObject):
     def run(self, search, action):
         pass

- def prepare():
+ def prepare(self):
         pass

- def teardown():
+ def teardown(self):
         pass

- def createRunOptions(widget):
+ def createRunOptions(self, widget):
         pass

- def reloadConfiguration():
+ def reloadConfiguration(self):
         pass

Changed in kde-workspace (Ubuntu):
assignee: nobody → Harald Sitter (apachelogger)
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kde-workspace - 4:4.11.4-0ubuntu1

---------------
kde-workspace (4:4.11.4-0ubuntu1) trusty; urgency=low

  [ Harald Sitter ]
  * Add upstream_Fix-traceback-in-Python-runner-plugins.patch
    from upstream fixing annoying backtraces when having a python krunner
    plugin installed (LP: #1258088)

  [ Philip Muškovac ]
  * New upstream bugfix release
  * Bump kdm breaks/replaces on kde-workspace-data to << 4:4.11.4-0ubuntu1~
 -- Harald Sitter <email address hidden> Fri, 06 Dec 2013 10:21:29 +0100

Changed in kde-workspace (Ubuntu):
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.