Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #7990 -- Modified serializers to use StringIO, rather than cStr…

…ingIO, due to potential unicode issues.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8151 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 56bbe0aa462130c29af35e732f56b381644895cb 1 parent 4454bde
@freakboy3742 freakboy3742 authored
View
6 django/core/serializers/base.py
@@ -2,10 +2,8 @@
Module for abstract serializer/unserializer base classes.
"""
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
+from StringIO import StringIO
+
from django.db import models
from django.utils.encoding import smart_str, smart_unicode
from django.utils import datetime_safe
View
9 django/core/serializers/json.py
@@ -3,14 +3,13 @@
"""
import datetime
-from django.utils import simplejson
+from StringIO import StringIO
+
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.utils import datetime_safe
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
+from django.utils import simplejson
+
try:
import decimal
except ImportError:
View
8 django/core/serializers/pyyaml.py
@@ -4,14 +4,12 @@
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
+from StringIO import StringIO
+import yaml
+
from django.db import models
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as PythonDeserializer
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-import yaml
class Serializer(PythonSerializer):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.