Bug 520954 - kdeedu embeds python-mwclient and it's broken
kdeedu embeds python-mwclient and it's broken
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: kdeedu (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Ngo Than
Fedora Extras Quality Assurance
:
Depends On: 523789
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-02 18:37 EDT by Toshio Ernie Kuratomi
Modified: 2009-10-13 21:48 EDT (History)
8 users (show)

See Also:
Fixed In Version: 0.6.3-3.fc11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-10-13 21:31:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Toshio Ernie Kuratomi 2009-09-02 18:37:22 EDT
Description of problem:
kdeedu has a plugin for parley that downloads sounds from wiktionary.  This plugin embeds a copy of python-mwclient.  mwclient in turn embeds a copy of python-simplejson.  These needs to be packaged separately (python-simplejson is in Fedora; python-mwclient is not)

Additionally, this plugin is broken.  It asks for a simplejson.scanner.Scanner() object but the simplejson that is included does not have this code.  it doesn't exist in simplejson-2.0.9 either.  However, it does exist in python-2.6's json modules (simplejson was imported into python for 2.6/3.0).  So, for kdeedu on F-11+, the fix for mwclient would be to use:

  import json as simplejson

Version-Release number of selected component (if applicable):
kdeedu-4.3.0-6.fc11.i586

How reproducible:
Every time

Steps to Reproduce:
1. $ parley
2. 
3.
  
Actual results:
Get a traceback on the console that has this:
  File "/usr/share/kde4/apps/parley/plugins/wiktionary_sound.py", line 14, in <module>                                                                            
    import mwclient                                                              
[...]
  File "<string>", line 18, in _import
  File "/usr/share/kde4/apps/parley/plugins/mwclient/simplejson/decoder.py", line 6, in <module>
    from simplejson.scanner import Scanner, pattern
"
ImportError: cannot import name Scanner


Expected results:
parley runs with system libraries and does not traceback.

Additional info:
Comment 1 Toshio Ernie Kuratomi 2009-09-02 18:40:26 EDT
mwclient home page:
http://sourceforge.net/apps/mediawiki/mwclient/
Comment 2 Toshio Ernie Kuratomi 2009-09-02 18:49:36 EDT
Regarding the traceback; I've looked at the code that's causing it.  When kdeedu is changed to import the system python-mwclient, the traceback will go away.  The traceback is occurring because the embedded mwclient is importing the embedded simplejson which is then importing the system version of simplejson.scanner -- which has no Scanner() object.  Moving all this out to system versions will make it self-consistent.
Comment 3 Rex Dieter 2009-09-20 14:28:59 EDT
python-mwclient review underway in bug #523789
Comment 4 Rex Dieter 2009-09-20 15:31:34 EDT
OK, using the copy of mwclient from bug #523789, I get python error(s):

fetching sound
checking sound for bar
Language: En-us  Word:  bar
Kross: "PythonInterpreter::extractException:
  File "/usr/share/kde4/apps/parley/plugins/wiktionary_sound.py", line 26, in fetchSound
    fetchSoundForTranslation(word)

  File "/usr/share/kde4/apps/parley/plugins/wiktionary_sound.py", line 35, in fetchSoundForTranslation
    soundfile = getWikiObject(wikiLocale, word.text, None)

  File "/usr/share/kde4/apps/parley/plugins/wiktionary_sound.py", line 75, in getWikiObject
    commons = mwclient.Site('commons.wikimedia.org')

  File "/usr/lib/python2.6/site-packages/mwclient/client.py", line 84, in __init__
    self.site_init()

  File "/usr/lib/python2.6/site-packages/mwclient/client.py", line 103, in site_init
    self.version = (int(version[0]), int(version[1][:-5]), 'alpha-wmf')
"
ValueError: invalid literal for int() with base 10: '16alph'
Comment 5 Kevin Kofler 2009-09-20 16:02:46 EDT
That needs to be patched in python-mwclient. (The [1][:-5] in line 103 of client.py needs to be changed to [:-9]. They didn't count the "-wmf".)
Comment 6 Rex Dieter 2009-09-20 16:03:00 EDT
Looks like it was a bug in mwclient-0.6.3 fixed already in their upstream trunk/  , we can apply the patch before building/updating anything.
Comment 7 Kevin Kofler 2009-09-20 16:03:31 EDT
(To be clear, [1][:-5] needs to be changed to [1][:-9].)
Comment 8 Rex Dieter 2009-09-21 14:31:52 EDT
step1 of fixing this, omitting the broken/embedded copy of mwclient/simplejson:

%changelog
* Sun Sep 20 2009 Rex Dieter <rdieter@fedoraproject.org> - 4.3.1-2
- kdeedu embeds python-mwclient and it's broken (#520954)
- Requires: kross-python


when python-mwclient becomes available, we'll add a
Requires: python-mwclient
here
Comment 9 Fedora Update System 2009-09-22 11:22:04 EDT
python-mwclient-0.6.3-3.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/python-mwclient-0.6.3-3.fc10
Comment 10 Fedora Update System 2009-09-22 11:23:46 EDT
python-mwclient-0.6.3-3.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/python-mwclient-0.6.3-3.fc11
Comment 11 Fedora Update System 2009-09-22 16:46:57 EDT
kdeedu-4.3.1-3.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/kdeedu-4.3.1-3.fc11
Comment 12 Fedora Update System 2009-09-22 16:47:54 EDT
kdeedu-4.3.1-3.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/kdeedu-4.3.1-3.fc10
Comment 13 Fedora Update System 2009-09-24 01:06:40 EDT
python-mwclient-0.6.3-3.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python-mwclient'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-9804
Comment 14 Fedora Update System 2009-09-24 01:11:22 EDT
python-mwclient-0.6.3-3.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python-mwclient'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9834
Comment 15 Fedora Update System 2009-09-25 16:11:36 EDT
kdeedu-4.3.1-3.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kdeedu'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9935
Comment 16 Fedora Update System 2009-09-25 16:13:50 EDT
kdeedu-4.3.1-3.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kdeedu'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-9949
Comment 17 Fedora Update System 2009-10-03 15:01:00 EDT
kdeedu-4.3.1-4.fc11, digikam-0.10.0-3.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kdeedu digikam'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9935
Comment 18 Fedora Update System 2009-10-03 15:10:57 EDT
kdeedu-4.3.1-4.fc10, digikam-0.10.0-3.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kdeedu digikam'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-9949
Comment 19 Fedora Update System 2009-10-13 21:31:19 EDT
kdeedu-4.3.1-4.fc11, digikam-0.10.0-3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 20 Fedora Update System 2009-10-13 21:33:59 EDT
kdeedu-4.3.1-4.fc10, digikam-0.10.0-3.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 21 Fedora Update System 2009-10-13 21:45:41 EDT
python-mwclient-0.6.3-3.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 22 Fedora Update System 2009-10-13 21:47:53 EDT
python-mwclient-0.6.3-3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

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