python packages versus pydoc -k

Bohuslav Kabrda bkabrda at redhat.com
Fri Mar 14 07:05:12 UTC 2014


----- Original Message -----
> Sorry, I should have tried pdb first, because this one has nothing to do
> with rpm-python.  I can see modname='PyQt4.uic.pyuic', and prior to the
> exception site is a line 'loader = importer.find_module(modname)', which
> is where the None came from.  I can confirm this one in a clean mock
> root with just PyQt4 added (and its dependencies).
> 
> This one might be a bug in the way pydoc -k iterates, because I can't
> even target that name directly:
> 
> $ pydoc PyQt4.uic.pyuic
> no Python documentation found for 'PyQt4.uic.pyuic'
> 
> $ python -c 'import PyQt4.uic.pyuic'
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> ImportError: No module named pyuic
> 

It seems that PyQt4/uic/pyuic.py is a symlink to /usr/bin/pyuic4, which is in PyQt4-devel. This means that the file is not importable when PyQt4-devel is not installed.
IMO this is both:
1) packaging problem, since the symlink shouldn't be there if the file it points to isn't installed.
2) pydoc problem, because it should try/except broken and unimportable files

I opened a rhbz#1076346 for 1)
And I'll try to figure out a good patch for upstream and send it there to fix 2)

Slavek.


More information about the devel mailing list