title: Python error TypeError: must be string or buffer, not instance
body: <p>i am trying to download some images which are listed in QListWidget i am passing the links to the urllib but its giving me <strong><em>TypeError: must be string or buffer, not instance</em></strong> this error. I tried looking up here but couldn't find any solution here is my code. Thanks </p>
  
  <pre><code>    def downloadStuff(self):
      files = self.listWidget.selectedItems()
      for filename in files:
          filename = filename.text()
          filename = str(filename)
          print filename
          xfilename = filename.split('/')[-1]
          with open('D:/'+xfilename,'wb') as imageFile:
              print filename
              imageFile.write(urllib.urlopen(filename)).read()
          imageFile.close()
  </code></pre>