Commits

Mauro Scomparin committed 38233fc

Now it works on windows.. (added binary opening on the image file.)

  • Participants
  • Parent commits 0fac7e3

Comments (0)

Files changed (1)

tumbrlPicUploader.py

 	print program_author
 	
 def saveCredentialsToFile(credentials,fileCred):
-	fileToWrite = open(fileCred,'w')
+	fileToWrite = open(fileCred,'wb')
 	fileToWrite.write(json.dumps(credentials))
 	fileToWrite.close()
 
 	saveCredentialsToFile(credentials,fileCred)
 	
 def getCredentialsFromFile(fileCred):
-	fileToRead = open(fileCred,'r')
+	fileToRead = open(fileCred,'rb')
 	crendentials = json.loads(fileToRead.read())
 	fileToRead.close()
 	return crendentials
 	params['tags'] = results.tags
 	i = 1
 	for img in glob.glob( os.path.join(results.dirname, file_mask) ):
-		params['data[%d]' % (i-1) ] = file(img).read()
+                #windows opens file like it wants.. added the read binary and looks like it likes it..
+		params['data[%d]' % (i-1) ] = file(img,'rb').read()
 		i+=1
 		print(img)
 	print api.createPost(creds['blogname'],params);