[PyKDE] QIODevice.readBlock must return a tuple

Yann Cointepas yann at sapetnioc.org
Thu May 19 19:18:08 BST 2005


But, it fails if I return a tuple containing the size and the string (a 
message indicating a wrong return type is shown). It only work if a tuple 
containing a single string is returned. If I understand sip (I first looked 
to the *.sip yesterday) I would say it is due to this line in 
%VirtualCatcherCode of readBlock in qiodevice.sip :

sipParseResult(&sipIsErr,sipMethod,result,"(O)",&buf);

My Qt version is > 3.0.0 but the same line is used twice so I think it is the 
same for all versions.


Le jeudi 19 Mai 2005 17:52, vous avez écrit :
> > When subclassing QIODevice, I noticed (with a look at qiodevice.sip) that
> > readBlock method must return a tuple with a string. I would expect this
> > method to return a string. But my knowledge of sip/PyQt is not enough to
> > say
> > if it is a bug or not.
>
> It's not a bug - it returns a tuple of the length of the data and the data
> itself. I agree it could be made more Pythonic - just return the data as
> you suggest (maybe PyQt4).
>
> Phil

-- 
Yann Cointepas                         Tel: +33 1 69 86 78 52
CEA - SHFJ                             Fax: +33 1 69 86 77 86
4, place du Général Leclerc
91401 Orsay Cedex France




More information about the PyQt mailing list