[PyQt] Invalid types for qRegisterResourceData

Florian Bruhin me at the-compiler.org
Wed Sep 7 22:43:20 BST 2016


This just came up in the #pyqt IRC channel:

Using qRegisterResourceData with a string says one should use a string
instead:

    >>> from PyQt5.QtCore import qRegisterResourceData
    >>> qRegisterResourceData(0,'x','x','x')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: qRegisterResourceData(int, str, str, str): argument 2 has unexpected type 'str'

Seems like bytes work though:

    >>> qRegisterResourceData(0,b'x',b'x',b'x')
    False

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160907/2d6110f1/attachment.sig>


More information about the PyQt mailing list