Skip to content Skip to sidebar Skip to footer

Python Error Typeerror: Must Be String Or Buffer, Not Instance

i am trying to download some images which are listed in QListWidget i am passing the links to the urllib but its giving me TypeError: must be string or buffer, not instance this er

Solution 1:

It's hard to say for sure without seeing the stack trace, but I suspect this line:

imageFile.write(urllib.urlopen(filename)).read()

Should instead be:

imageFile.write(urllib.urlopen(filename).read())

Incidentally, you don't need the imageFile.close() line, because the with statement closes the file for you automatically.

Post a Comment for "Python Error Typeerror: Must Be String Or Buffer, Not Instance"