From pykde Thu May 19 18:18:08 2005 From: Yann Cointepas Date: Thu, 19 May 2005 18:18:08 +0000 To: pykde Subject: Re: [PyKDE] QIODevice.readBlock must return a tuple Message-Id: <200505192018.08415.yann () sapetnioc ! org> X-MARC-Message: https://marc.info/?l=pykde&m=111752989202620 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 _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde