Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.X compatibility #10

Closed
wants to merge 1 commit into from
Closed

Python 3.X compatibility #10

wants to merge 1 commit into from

Conversation

ogier
Copy link

@ogier ogier commented Jan 1, 2012

I made the library compatible with 3.X, though there are probably still string encoding bugs because of the way Python 3 handles strings. Importantly, the library should still behave identically on python 2.X.

Backwards compatibility with python 2.X is preserved. Python 3
probably has some bugs, especially with regards to string encoding
(for example, _encode_multipart_form() in facebook.py).
@martey martey mentioned this pull request Jan 2, 2012
@ash211
Copy link
Contributor

ash211 commented Jan 10, 2012

Sorry @ogier, but "mostly compatible" with Python 3 doesn't give me the greatest feelings :)

Like @martey says in #5, most people using this library are on Python 2, and I'm one of them. I won't be able to help with testing, but if it's working for people and doesn't break backwards compatibility I think we'd love to enable Python 3 support in this library.

Thoughts?

@martey
Copy link
Member

martey commented Mar 16, 2012

PEP 414 looks like it might help with the strings. Since it looks like it has already been implemented in the prerelease versions of Python 3.3, I will try to do some testing.

@ogier
Copy link
Author

ogier commented Mar 16, 2012

Alright. I would look at the specification of urlopen's data argument, which is expected to be a bytes object in py3. _encode_multipart_form does a bunch of ascii fiddling, and we need a way to do that in a cross-compatible way.

http://docs.python.org/library/urllib2.html#urllib2.urlopen
http://docs.python.org/dev/library/urllib.request#urllib.request.urlopen

@akhilpo
Copy link

akhilpo commented May 3, 2012

hey i am getting the following installation error while installing using pip on windows running python 3.2:

"C:\Python32\Scripts>pip install http://github.com/pythonforfacebook/facebook-sdk
/tarball/master
Downloading/unpacking http://github.com/pythonforfacebook/facebook-sdk/tarball/m
aster
Downloading master
Running setup.py egg_info for package from http://github.com/pythonforfacebook
/facebook-sdk/tarball/master

Installing collected packages: facebook-sdk
Running setup.py install for facebook-sdk
File "C:\Python32\Lib\site-packages\facebook.py", line 192
except urllib2.HTTPError, e:
^
SyntaxError: invalid syntax

Successfully installed facebook-sdk
Cleaning up..."

When I execute 'help('modules') on IDLE, it does shows a module named "facebook". But I cannot import that library. Throws a trackback error. Please fix this.

@martey
Copy link
Member

martey commented May 4, 2012

@0xakhil, this library does not currently support Python 3. You can try to integrate the changes that @ogier made, but they may not work completely.

@akhilpo
Copy link

akhilpo commented May 4, 2012

Thanks. It installed successfully. Is it completely compactible?

@eljeffeg eljeffeg mentioned this pull request Aug 8, 2012
@canercandan
Copy link

@martey Why dont you create a new branch dedicated to a python3 compatible version separated from the master (python2) one ?

@martey
Copy link
Member

martey commented Nov 26, 2013

As I wrote on the mailing list last month, the next release will support Python 3. I still have some changes and testing to do (which are likely to involve lots of rebasing), but I will make them available in a separate branch soon so that the community can test them before they are merged to master.

@martey
Copy link
Member

martey commented Feb 10, 2014

This should be fixed by d0eb831. Any Python 3 bugs should be reported in a new issue.

@martey martey closed this Feb 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants