Comments (19)
Next release will be python3 compatible. Probably at the end of the month.
from restkit.
ok, finally got most of the bits to port restkit to py3. restkit will use http-parser in next release which support py3. net restkit will be online in 1 or 2 weeks with python3 support and somme enhancements. This version will also drop support for py2.5 .
from restkit.
Is there a status update on python 3 support ? I was thinking of hacking up a small program this weekend to learn python3 and was thinking of using restkit for REST stuff. (otherwise i'll just fall back to python2 and port when available)
from restkit.
available in 021104a .
from restkit.
I tried cloning 021104a and installing it, but when I import it in python3 there are a lot of errors. Exceptions still use python2 syntax and imported modules still use python2 names. Are you sure that's the right commit ?
from restkit.
you can't just import you need toiinstall it or patch it manually with
2to3 . work in progress anyway.
- benoit
On Monday, June 20, 2011, gelendir
[email protected]
wrote:
I tried cloning 021104a and installing it, but when I import it in python3 there are a lot of errors. Exceptions still use python2 syntax and imported modules still use python2 names. Are you sure that's the right commit ?
Reply to this email directly or view it on GitHub:
#47 (comment)
from restkit.
Are you interested in using six (http://packages.python.org/six/) to make a version which doesn't need patching with 2to3? I've just done that for restpose-py, and it seemed a reasonable approach, though there may be harder issues to fix for restkit.
from restkit.
Scratch that comment - I see that installing does the 2to3 conversion - clever, and cunning.
I can't get it to work yet, though (though it does import ok once installed); may be I'm calling it wrong.
from restkit.
On Sunday, July 24, 2011, rboulton <
[email protected]>
wrote:
Scratch that comment - I see that installing does the 2to3 conversion -
clever, and cunning.I can't get it to work yet, though (though it does import ok once
installed); may be I'm calling it wrong.Reply to this email directly or view it on GitHub:
#47 (comment)py3 version need some work. i'm currently refactoring the client to make it
happen.
- benoit
from restkit.
Cool - I look forward to testing it.
from restkit.
seems to install fine with Python 3 (3.2.2 here), but a demo that tries OAuth fails with:
File "/home/damjan/py/lib/python3.2/site-packages/restkit/__init__.py", line 107, in request
headers=headers)
File "/home/damjan/py/lib/python3.2/site-packages/restkit/client.py", line 450, in request
ret = f.on_request(request)
File "/home/damjan/py/lib/python3.2/site-packages/restkit/filters.py", line 95, in on_request
oauth_req.sign_request(self.method, self.consumer, self.token)
File "/home/damjan/py/lib/python3.2/site-packages/restkit/oauth2.py", line 472, in sign_request
self['oauth_body_hash'] = base64.b64encode(sha(self.body).digest())
TypeError: Unicode-objects must be encoded before hashing
the code is :
consumer = oauth.Consumer(consumer_key, consumer_secret)
token = oauth.Token(oauth_token, oauth_token_secret)
auth = OAuthFilter("*", consumer, token)
req = request('https://userstream.twitter.com/2/user.json', filters=[auth])
from restkit.
regarding the last exception, it seems to be created by several occurences of body='' which is not translated by 2to3.
Maybe it should be replaced with body=bytes() (or body=None, and then change it in the code).
bytes() is available in 2.6, 2.7 and 3.2, didn't check others.
from restkit.
Hi, when will be ready py3 support?
from restkit.
sometimes next week. i've most of the tests passing on a test branch here, but I need to do a small refactoring first.
from restkit.
@benoitc thank you, if you need any help please let me know I am using restkit as base of one project.
from restkit.
restkit seems to work in Python 3 if I run 2to3 manually, but when I install restkit from PyPI that doesn't happen – should it? (I don't see any 2to3 setup in setup.py)
from restkit.
There is the 3 years old version of restkit on PyPI. Please, do you consider to finalize Python 3 version, and update PyPI?
from restkit.
The py3 support actually only requires a few things to be done, it seems:
- Search cStringIO or StringIO import and replace with "from io import StringIO"
- Replace "import urlparse" with "from urllib.parse import urlparse"
- Ditto for import urlunparse, parse_qs and parse_qsl
- Search all "except" statements and replace comma with " as ".
Haven't actually tested this yet, but import is no longer failing :)
from restkit.
There is a pull request to support python 3. Just not finished.
from restkit.
Related Issues (20)
- Documentation fails to build with Sphinx 1.2 HOT 1
- Document Error: Mixed case pool object typo in gevent example
- tests being installed in generic "tests" directory HOT 1
- Can't set headers per part of multipart requests HOT 1
- Add documentation on proxy usage
- Auth failed when password contains encoded / (slash)
- testsuite of -4.2.2; errors=6 HOT 1
- wsgi proxy and 'hop by hop' HOT 3
- WSGI proxy and Forwarded header
- un-contrib-ifying the proxy HOT 2
- minor performance optimization concerning location
- data coming out in wrong request HOT 1
- HostProxy misbehaves with spaces in PATH_INFO
- IOError: [Errno 0] Error on write() in tee.TeeInput._tee
- Doesn't Validate TLS HOT 4
- Exception in thread Thread-1 (most likely raised during interpreter shutdown
- no proxy support in restkit oauth? HOT 1
- Documentation for forms.py
- Attaching file to test result in test management 4 jira
- Proposing a PR to fix a few small typos
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 restkit.