Closed SevereOverfl0w closed 10 years ago
Same error on a PUT request.
In order to reproduce bug with existing test you have to patch FakeHTTPResponse
object.
import six
class FakeHttpResponse(object):
def __init__(self, body, content_type='text/html'):
self.body = body
if six.PY3:
self.body = body.encode('utf-8')
self.content_type = content_type
self.status_code = 200
I think most web framework consider string representation as utf-8, so bytes in Python 3 (like Django, and Pyramid @SevereOverfl0w ). Can we update tests and quickly think about a solution ?
For me, this bug is very important cause it make restless unusable with Django in Python3 and I think it's the same thing for Pyramid below.
By the way, thank you for your great work @toastdriven , I just leave django-restframework to restless give a a very nice breath of air :smile:
I can make a pull request if you want but I'm not totally of how to fix it. But the nice coverage will be a good point.
For what it's worth, @toastdriven other people are now encountering this. I've made a cursory pass at @socketubs' pull request (#17) and it looks acceptable. It's simple and @socketubs may still be willing to revisit it if you would offer feedback.
Fixed in SHA: 5376ac2
Just been playing with this using Pyramid, and mildly following the tutorial.
I am hitting an issue with an error:
I believe this is a python 2 vs 3.4 issue. But I am not sure if it's an error I am making, or something within the framework!
This occurs when trying to post with CURL to create a new minion. It occurs before it even hits my function ( I believe! )
Traceback: