[PyQt] QString rfind exception in uic.loadUi

Gökçen Eraslan gokcen at pardus.org.tr
Tue Sep 14 07:23:52 BST 2010


Hello,

When I run this code:

from PyQt4 import uic
from PyQt4.QtCore import QString
uic.loadUi(QString("notexists.ui"))

in sip 4.10.2 and PyQt 4.7.3, I'm getting 

-----------------
Traceback (most recent call last):
...
...
IOError: [Errno 2] No such file or directory: 
PyQt4.QtCore.QString(u'notexists.ui')
-----------------

as usual but in sip 4.11.1 and PyQt 4.7.6, I'm getting:

-----------------
Traceback (most recent call last):
  File "uicexample.py", line 7, in <module>
    uic.loadUi(QString("notexists.ui"))
  File "/usr/lib/python2.7/site-packages/PyQt4/uic/__init__.py", line 182, in 
loadUi
    return DynamicUILoader().loadUi(uifile, baseinstance)
  File "/usr/lib/python2.7/site-packages/PyQt4/uic/Loader/loader.py", line 24, 
in loadUi
    return self.parse(filename, os.path.dirname(filename))
  File "/usr/lib/python2.7/posixpath.py", line 119, in dirname
    i = p.rfind('/') + 1
AttributeError: 'QString' object has no attribute 'rfind'
-----------------

Any ideas about that?

-- 
Gökçen Eraslan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100914/bf6ae361/attachment.pgp>


More information about the PyQt mailing list