alexis-mignon / python-flickr-api

A python implementation of the Flickr API
BSD 3-Clause "New" or "Revised" License
367 stars 108 forks source link

"General upload failure" in windows #53

Closed makechaos closed 9 years ago

makechaos commented 9 years ago

First of all thanks for putting together this package - use it in my home photo-server to upload to flickr.

However when I my server in windows (v7) OS platform it failed to upload photos to flickr giving a message "3: General upload failure". Going through the code I found the error was in how the file is being read in upload.post - it uses open(photo_file).read() to load the image data. However as noted here (https://docs.python.org/2/tutorial/inputoutput.html, section 7.2) the default flags can have problems with binary files in windows.

The problem was solved when I included "rb" flags (i.e open(photo_file,"rb").read()). This change would make the package truly OS independent.

Vikram

alexis-mignon commented 9 years ago

Thx for the report. Fixed