Fix another python 3 and unicode issue
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 11 Feb 2016 22:47:04 +0000 (14:47 -0800)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 11 Feb 2016 22:47:04 +0000 (14:47 -0800)
mediagoblin/tools/request.py

index af06967b9ad53d72d303c6531a77d0dbafd7016a..7e1973d309fcb8987823ae277089bfeea4cf87e2 100644 (file)
@@ -17,6 +17,7 @@
 import json
 import logging
 
+import six
 from werkzeug.http import parse_options_header
 
 from mediagoblin.db.models import User, AccessToken
@@ -65,7 +66,7 @@ def decode_request(request):
     content_type, _ = parse_options_header(request.content_type)
 
     if content_type == json_encoded:
-        data = json.loads(data)
+        data = json.loads(six.text_type(data, "utf-8"))
     elif content_type == form_encoded or content_type == "":
         data = request.form
     else: