RichIPythonWidget import side effect on pkgutil module
Question: Apparently, importing RichIPythonWidget has an impact on module pkgutil.

# Test environment:

IPython version: 2.1.0 python versions: 2.7 & 2.7.6

# Code showing issue:

    
    
    import os
    import pkgutil
    
    print 'Before 1 ... '
    pkgutil.find_loader('os') # call 1
    print 'After call 1 ... '
    
    from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
    
    print 'Before call 2 ... '
    pkgutil.find_loader('os') # call 2
    print 'After call 2 ... '
    

# Output:

    
    
    Before call 1 ... 
    After call 1 ... 
    Before call 2 ... 
    Traceback (most recent call last):
      File "issue.py", line 11, in <module>
        pkgutil.find_loader('os') # call 2
      File "/u/bl/Dev/work/inkqt/opt.SuSE-11.4/lib64/python2.7/pkgutil.py", line 467, in find_loader
        loader = importer.find_module(fullname)
    TypeError: find_module() takes exactly 3 arguments (2 given)
    

As far as i understand, my issue seems to be related to objects added to
**sys.meta_path** by **IPython** but used with the wrong interface by
**pkgutil** module. But it's hard for me to decide who's guilty...

Any workaround would be greatly appreciated.

thx

-benoit


Answer: This is most likely due to the Qt ImportDenier installed by IPython in
IPython/external/qt_loaders.py. The find_module method does not respect the
PEP302 signature of `finder.find_module(fullname, path=None)`, where the path
is optional.

I submitted an issue on IPython:
<https://github.com/ipython/ipython/issues/5932>.

