Exception in thread Thread-2: Traceback (most recent call last): File "threading.py", line 460, in __bootstrap self.run() File "/home/hylke/starez/src/client/Downloader.py", line 61, in run if not self.GetDownload(self.m_outputfile, self.m_start_byte): File "/home/hylke/starez/src/client/Downloader.py", line 83, in GetDownload fo = file(outputfile, "wb") TypeError: coercing to Unicode: need string or buffer, int found My code: def GetDownload(self, socket, outputfile, start_byte = None): fo = None if outputfile: print "Bestand geopent" if start_byte: fo = file(outputfile, "ab") else: fo = file(outputfile, "wb") # <== line 83 [..]