Bug 520954

Summary: kdeedu embeds python-mwclient and it's broken
Product: [Fedora] Fedora Reporter: Toshio Ernie Kuratomi <a.badger>
Component: kdeeduAssignee: Than Ngo <than>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: fedora, jreznik, kevin, lorenzo, ltinkl, rdieter, smparrish, than
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.6.3-3.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-14 01:31:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 523789    
Bug Blocks:    

Description Toshio Ernie Kuratomi 2009-09-02 22:37:22 UTC
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 22:40:26 UTC
mwclient home page:
http://sourceforge.net/apps/mediawiki/mwclient/

Comment 2 Toshio Ernie Kuratomi 2009-09-02 22:49:36 UTC
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 18:28:59 UTC
python-mwclient review underway in bug #523789

Comment 4 Rex Dieter 2009-09-20 19:31:34 UTC
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 20:02:46 UTC
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 20:03:00 UTC
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 20:03:31 UTC
(To be clear, [1][:-5] needs to be changed to [1][:-9].)

Comment 8 Rex Dieter 2009-09-21 18:31:52 UTC
step1 of fixing this, omitting the broken/embedded copy of mwclient/simplejson:

%changelog
* Sun Sep 20 2009 Rex Dieter <rdieter> - 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 15:22:04 UTC
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 15:23:46 UTC
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 20:46:57 UTC
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 20:47:54 UTC
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 05:06:40 UTC
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 05:11:22 UTC
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 20:11:36 UTC
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 20:13:50 UTC
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 19:01:00 UTC
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 19:10:57 UTC
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-14 01:31:19 UTC
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-14 01:33:59 UTC
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-14 01:45:41 UTC
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-14 01:47:53 UTC
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.