Created
July 11, 2014 08:32
-
-
Save tkusano/e5512544efdff8702b7d to your computer and use it in GitHub Desktop.
dajaxice-ng-python3.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -x tests -x __pycache__ -uNr dajaxice.orig/core/__init__.py dajaxice/core/__init__.py | |
--- dajaxice.orig/core/__init__.py 2014-01-19 18:17:40.000000000 +0900 | |
+++ dajaxice/core/__init__.py 2014-07-03 18:02:09.260024999 +0900 | |
@@ -1,6 +1,6 @@ | |
from django.conf import settings | |
-from Dajaxice import Dajaxice, dajaxice_autodiscover | |
+from .Dajaxice import Dajaxice, dajaxice_autodiscover | |
class DajaxiceConfig(object): | |
diff -x tests -x __pycache__ -uNr dajaxice.orig/utils.py dajaxice/utils.py | |
--- dajaxice.orig/utils.py 2013-11-19 13:22:51.000000000 +0900 | |
+++ dajaxice/utils.py 2014-07-06 16:27:41.404024999 +0900 | |
@@ -5,4 +5,4 @@ | |
""" | |
Create a new QueryDict from a serialized form. | |
""" | |
- return QueryDict(query_string=unicode(data).encode('utf-8')) | |
+ return QueryDict(query_string=str(data).encode('utf-8')) | |
diff -x tests -x __pycache__ -uNr dajaxice.orig/views.py dajaxice/views.py | |
--- dajaxice.orig/views.py 2014-01-19 18:13:42.000000000 +0900 | |
+++ dajaxice/views.py 2014-07-11 17:26:59.900024999 +0900 | |
@@ -12,20 +12,6 @@ | |
log = logging.getLogger('dajaxice') | |
- | |
-def safe_dict(d): | |
- """ | |
- Recursively clone json structure with UTF-8 dictionary keys | |
- http://www.gossamer-threads.com/lists/python/bugs/684379 | |
- """ | |
- if isinstance(d, dict): | |
- return dict([(k.encode('utf-8'), safe_dict(v)) for k, v in d.iteritems()]) | |
- elif isinstance(d, list): | |
- return [safe_dict(x) for x in d] | |
- else: | |
- return d | |
- | |
- | |
class DajaxiceRequest(View): | |
""" Handle all the dajaxice xhr requests. """ | |
@@ -42,10 +28,7 @@ | |
# Clean the argv | |
if data != 'undefined': | |
- try: | |
- data = safe_dict(json.loads(data)) | |
- except Exception: | |
- data = {} | |
+ data = json.loads(data) | |
else: | |
data = {} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment