[PyQt] QNetworkAccessManager seems to misbehave

Benjamin Sonnemann mail at sonnemann-it.de
Wed May 5 10:57:01 BST 2010


Hi,

i got following code:


     def fetchFile(self):
         self.nam.finished.connect(self.finished) #self.nam =  
QtNetwork.QNetworkAccessManager() somewehere before
         request =  
QtNetwork.QNetworkRequest(QtCore.QUrl("ftp://someuser:somepass@some.host.com/somefile.csv"))
         reply = self.nam.get(request);


     @QtCore.pyqtSlot(QtNetwork.QNetworkReply)
     def finished(self, reply):
         print "received csv"
         print reply.url()
         print reply.error()

The problem is, finished is called immediately with error number 203,
meaning ContentNotFoundError. So you may say invalid URL, but if i
paste the same URL in C++ code, it works fine.

-- 
Benjamin Sonnemann


More information about the PyQt mailing list