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.3 support #124
Python 3.3 support #124
Conversation
The unfixed parse_querystring() raises the following exception in Python 3.3: TypeError: Type str doesn't support the buffer API Also removed iteritems() as it is deprecated and no longer supported in Python 3.x
I tested this branch against https://github.com/openstack/python-keystoneclient in py33 and it appears to have fixed all of our blockers caused by httpretty - thanks! |
I like what the keystoneclient folks have done with this. Is 3.3 support going to be a long time coming? |
I just stumbled upon the fact that Python 3.3 support is broken, was using it in a test suite that's now erring. |
I need to find time to work on the |
fix(travis): reqs.pip -> reqs.txt
feat: tox support
The I did notice one thing, the headers suddenly became title-cased. It used to be a dict like this: headers = {
'accept' = 'applicaiton/json',
'accept-charset' = 'utf-8',
} But now they're like this: headers = {
'Accept' = 'applicaiton/json',
'Accept-Charset' = 'utf-8',
} |
Just like @jamielennox (and probably for the same reason), I'm interested in porting HTTPretty to Python 3 as quickly as possible. I've taken a quick look at the test suite, and this looks doable. Are Github pull requests the preferred way of sending patches ? |
By the way, it might be nice to rebase the py3 branch on top of master right away. |
+1 for py33 support. I'm starting a new project and would love to rely on HTTPretty in my functional tests. |
@fcy You may want to take a look at https://github.com/CyrilRoelandteNovance/HTTPretty/tree/clean_py3 There are 11 patches on this branch, and it has Python 3 support. I'll probably merge it on master soon (just waiting for some packaging issues to be fixed first). In the meantime, if you could test it, that'd be great! |
@CyrilRoelandteNovance +1 for merging into master as long travis built passes 👍 |
@@ -490,7 +502,7 @@ def __init__(self, method, uri, body, | |||
self.forcing_headers = forcing_headers or {} | |||
self.status = int(status) | |||
|
|||
for k, v in headers.items(): | |||
for k, v in list(headers.items()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you add 'list()' here? Generic python iterator is more memory efficient
OK, so I've just proposed #143 If you're interested in Python 3 support, please test ! Also, this branch is some sort of an 0.8-rc1 for HTTPretty: I'd like to release 0.8 soon, with Python 3 support and improved packaging as the main enhancements. |
@CyrilRoelandteNovance sorry I've been out of this for a while. |
So eh, what's the state of this now? @CyrilRoelandteNovance's #143 was closed but nothing merged and this seems to be in limbo too. |
@daenney Hum, Python 3 support has been merged a while ago. if I'm not mistaken, it's part of 0.8, and is used by python-keystoneclient in OpenStack, for instance :) |
Right, Perhaps we should close this issue then, this is confusing. |
Hi @CyrilRoelandteNovance, @daenney so can it be closed? |
Yep, and I'm closing it. |
This pull request is just a reference to the branch I created. As a result of an ongoing discussion brought up by @jamielennox at #118
In short python 3.3 support is going to be beneficial to some linux distributions.
The goal is to run
tox
and have all the tests passing for python 2.6, 2.7 and 3.3