parley scripts fail to load

Bug #371565 reported by David Erosa
26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KDE Educational Applications
Fix Released
Medium
kdeedu (Guadalinex Edu)
Undecided
Unassigned
kdeedu (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: kdeedu

When starting parley version 4:4.2.2-0ubuntu1, a few notifications notify about the imposibility of starting a few scripts. Running parlay from console results in the following output:

derosa@bowman:~$ LANG=C parley
/usr/share/themes/Guadalinex/gtk-2.0/gtkrc:56: Clearlooks configuration option "menuitemstyle" is not supported and will be ignored.
/usr/share/themes/Guadalinex/gtk-2.0/gtkrc:57: Clearlooks configuration option "listviewitemstyle" is not supported and will be ignored.
/usr/share/themes/Guadalinex/gtk-2.0/gtkrc:58: Clearlooks configuration option "progressbarstyle" is not supported and will be ignored.
parley(9663) KEduVocDocument::KEduVocDocument: constructor done
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
parley(9663) VocabularyView::reset: reset
Object::connect: No such slot VocabularyModel::setLeitnerBox(KEduVocLeitnerBox*)
Object::connect: No such slot LeitnerView::setTranslation(KEduVocExpression*, int)
parley(9663) Script::activate: Activating Script "/usr/share/kde4/apps/parley/plugins/leo-dict.py"
parley(9663) Script::activate: "Parley"
Kross: "Error error=Failed to determine interpreter for scriptfile "/usr/share/kde4/apps/parley/plugins/leo-dict.py" lineno=-1 trace=
"
parley(9663) Script::activate: Script not activated
parley(9663) Script::activate: Activating Script "/usr/share/kde4/apps/parley/plugins/example.py"
parley(9663) Script::activate: "Parley"
Kross: "Error error=Failed to determine interpreter for scriptfile "/usr/share/kde4/apps/parley/plugins/example.py" lineno=-1 trace=
"
parley(9663) Script::activate: Script not activated
parley(9663) Script::activate: Activating Script "/usr/share/kde4/apps/parley/plugins/google_images.py"
parley(9663) Script::activate: "Parley"
Kross: "Error error=Failed to determine interpreter for scriptfile "/usr/share/kde4/apps/parley/plugins/google_images.py" lineno=-1 trace=
"
parley(9663) Script::activate: Script not activated
parley(9663) Script::activate: Activating Script "/usr/share/kde4/apps/parley/plugins/google_dictionary.py"
parley(9663) Script::activate: "Parley"
Kross: "Error error=Failed to determine interpreter for scriptfile "/usr/share/kde4/apps/parley/plugins/google_dictionary.py" lineno=-1 trace=
"
parley(9663) Script::activate: Script not activated
parley(9663) ParleyMainWindow::switchComponent: switch to component 1
parley(9663) ParleyMainWindow::switchComponent: old component 0x0 QObject(0x0)
parley(9663) ParleyMainWindow::switchComponent: new component 0x0 WelcomeScreen(0x884df30, name = "WelcomeScreen")
Object::disconnect: Unexpected null parameter
QObject::connect: Cannot connect (null)::activePartChanged( KParts::Part * ) to KHTMLPart::slotActiveFrameChanged( KParts::Part * )
derosa@bowman:~$

The first lines of those scripts seem to be correct:

derosa@bowman:~$ head /usr/share/kde4/apps/parley/plugins/leo-dict.py
#!/usr/bin/env kross
# -*- coding: utf-8 -*-

import socket
import urllib2
import urllib
from sgmllib import SGMLParser
import Parley
import re

derosa@bowman:~$

Also, the "kross" command is available:
derosa@bowman:~$ /usr/bin/env kross
Syntax: kross scriptfile1 [scriptfile2] [scriptfile3] ...
derosa@bowman:~$

Revision history for this message
David Erosa (erosa) wrote :
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Do scripts start working if you install libkrosspython0?
Parley should at least have libkrosspython0 as a Recommends, so that it will get installed by default, but be removable without having to remove parley.

Revision history for this message
David Erosa (erosa) wrote :

I've manually installd libkrosspython0, as I've configured apt for not autoinstalling recomended packages.
Now the error is different. As the output is too long, I've attached it.

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

Upstream thinks splitting the scripts out and making that package depend on kross as well as the appropriate python stuff would be a good idea.

Though the problem that got exposed even with libkrosspython0 installed is a different one. I personally think it is a python 2.6 + Kross issue.

Google suggests only python2.6 system stumble upon such weird errors with Kross (then again I didn't find any trace of Fedora issues and AFAIK they are using 2.6 as well, so it might very well be Ubuntu specific).

For testing I'll attach a simple script, it really just imports Kross and ssl, whereas the latter is responsible for the error, although only in combination with the former. You can run the script with kross script.py

Note: this probably affects every script that uses urllib2, so pretty much every one accessing the Internet, so this is at least of Medium importance.

Changed in kdeedu (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Harald Sitter (apachelogger) wrote :
Revision history for this message
David Erosa (erosa) wrote :

This is the result of running the script under Jaunty:

derosa@bowman:/tmp$ kross script.py
Kross: "Loading the interpreter library for python"
Kross: "Successfully loaded Interpreter instance from library."
Kross: "PythonScript::Constructor."
Kross: "PythonScript::execute"
Kross: "PythonInterpreter::extractException:
  File "script.py", line 2, in <module>
    import ssl

  File "<string>", line 18, in _import

  File "/usr/lib/python2.6/ssl.py", line 81, in <module>
    class SSLSocket (socket):
"
Kross: "Error error=Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given) lineno=81 trace=
  File "script.py", line 2, in <module>
    import ssl

  File "<string>", line 18, in _import

  File "/usr/lib/python2.6/ssl.py", line 81, in <module>
    class SSLSocket (socket):
"
TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 38, in apport_excepthook
    from apport.packaging_impl import impl as packaging
  File "<string>", line 18, in _import
  File "/usr/lib/python2.6/dist-packages/apport/__init__.py", line 1, in <module>
    from apport.report import Report
  File "<string>", line 18, in _import
  File "/usr/lib/python2.6/dist-packages/apport/report.py", line 21, in <module>
    import fileutils
  File "<string>", line 18, in _import
  File "/usr/lib/python2.6/dist-packages/apport/fileutils.py", line 16, in <module>
    from packaging_impl import impl as packaging
  File "<string>", line 18, in _import
  File "/usr/lib/python2.6/dist-packages/apport/packaging_impl.py", line 18, in <module>
    import apt
  File "<string>", line 18, in _import
  File "/usr/lib/python2.6/dist-packages/apt/__init__.py", line 7, in <module>
    from apt.package import Package
  File "<string>", line 18, in _import
  File "/usr/lib/python2.6/dist-packages/apt/package.py", line 23, in <module>
    import httplib
  File "<string>", line 18, in _import
  File "/usr/lib/python2.6/httplib.py", line 1054, in <module>
    import ssl
  File "<string>", line 18, in _import
  File "/usr/lib/python2.6/ssl.py", line 81, in <module>
    class SSLSocket (socket):
TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)

Original exception was:
TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)
Kross: "PythonScript::Destructor."
Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)
  File "script.py", line 2, in <module>
    import ssl

  File "<string>", line 18, in _import

  File "/usr/lib/python2.6/ssl.py", line 81, in <module>
    class SSLSocket (socket):

derosa@bowman:/tmp$

Revision history for this message
Cedara (cedara2) wrote :

Ubuntu 9.04, installed parley with gnome as usual desktop. Same error about the scripts not loading, installing that library helps by letting the programme seemingly run smoother; it didn't solve that error though.

Revision history for this message
tessonec (tessonec) wrote :

I have the same error as all the others. I am running Parley 0.9.2 svn, and the error I get when running from the konsole is

Kross: "Loading the interpreter library for python"
Kross: "Interpreter skipped cause provided version 12 does not match expected version 11."
Kross: "Incompatible interpreter library."
Kross: "Error error=Failed to load interpreter "python" lineno=-1 trace=
"

I have the libkrosspython0 package installed. I tend to agree with the comment about python 2.6...

Changed in kdeedu:
status: Unknown → New
Revision history for this message
Sebastian Sauer (mail-dipe) wrote :

The bug should be fixed now and the fix in KDE 4.3 RTF. See also https://bugs.kde.org/show_bug.cgi?id=190729

Changed in kdeedu:
status: New → Fix Released
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Fixed in KDE 4.3 final.

Changed in kdeedu (Ubuntu):
status: Confirmed → Fix Released
Changed in kdeedu:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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