Comments (12)
req.data at line 190 has this fnky this_is_the_boundary stuff in it:
\x14P\x01E\x14P\x01E\x14P\x01E\x14P\x01E\x14P\x01E\x14P\x07\xff\xd9\r\n------------ThIs_Is_tHe_bouNdaRY_$\r\nContent-Disposition: form-data; name="message"\r\n\r\nhi\r\n------------ThIs_Is_tHe_bouNdaRY_$--\r\n'
from facebook-sdk.
Do you still get this error if you open the file in binary mode? If so, would it be possible for you to provide me with the image that is causing the error?
from facebook-sdk.
According to the docs binary mode only matters on windows and I'm on Linux. It also says it could corrupt JPEG files. I did try it but got the same exception.
Uploading the image does work with the facepy library that you can find here on github to compare how they are doing multipart forms.
Here is the failing photo:
http://studiosnaps.com/upload_26.jpg
from facebook-sdk.
If it helps, this was uploading a photo to a page's album, not a personal album.
from facebook-sdk.
I tried to replicate this error using the image file you provided, but I have been unable to (the image uploaded successfully each time). Can you confirm that you are using the most recent version of this library?
from facebook-sdk.
Yes, I was using the current version from master.
I'm using python 2.7.3 on Ubuntu LTS 12.04.
I was uploading to a fan/company page, not a personal profile page.
from facebook-sdk.
One of the computers I tested on is running python 2.7.3rc2. Since the error you are receiving is a UnicodeDecodeError
, it has nothing to do with the type of Facebook profile you are trying to upload the photo to.
I tried more testing, but can still not replicate the error you are receiving. I noticed that your original traceback mentions gevent. Do you still get the error if you are not using it (i.e. using python on the command line)?
from facebook-sdk.
@sontek, I have not heard anything from you on this, and there have been no additional reports of people with the same issue, so I am going to close this.
from facebook-sdk.
I'm getting a UnicodeDecodeError while trying to upload a PIL generated PNG, stored in a django model.
If I try to upload another file, it works fine. So I think it must be related with how I'm generating the image or something with PIL. I know I'm not providing much information, but do you have any ideas?
from facebook-sdk.
Digging a bit more, I see that put_photo assumed the image is JPG: https://github.com/pythonforfacebook/facebook-sdk/blob/master/facebook.py#L261
Why is that? Facebook doesn't allow PNG?
from facebook-sdk.
Why is that? Facebook doesn't allow PNG?
Some documentation from the old REST API I found suggests that the following file types are supported:
*GIF *JPG *PNG *PSD *TIFF *JP2 *IFF *WBMP *XBM
This is a bug in the library, but should be created as a new issue (since it is not the same issue as was originally reported).
from facebook-sdk.
Created 2 issues. Posting here for reference:
UnicodeDecodeError: #43
Hardcoded JPG format: #44
from facebook-sdk.
Related Issues (20)
- Release 4.0.0 to support after deprecation on 7/26/2020 HOT 5
- the package version is too old HOT 1
- How to get photo and message of a specific post via URL HOT 1
- get all connections support time-based pagination HOT 1
- Release support for Graph API version 8.0 HOT 2
- Why it's no v.8, but still 3.1.0 that is deprecated? HOT 3
- login-facebook HOT 1
- Replace the image of a facebook post
- Facebook graph
- [FEATURE REQUEST] Type hinting
- [Bug] Remove support for deprecated Graph API Version "3.1". HOT 3
- how we can post an image with caption to group or page i need help
- JSONDecodeError raised when trying to use put_object method HOT 1
- Update supported versions HOT 4
- H
- How can i put love react on post facebook API
- Hihu HOT 1
- Unable to fetch more than 25 comments
- Could I please receive all notifications and messages for this email
- Any New Release ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-sdk.