Permalink
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...
1 parent 4454bde commit 56bbe0aa462130c29af35e732f56b381644895cb @freakboy3742 freakboy3742 committed Jul 30, 2008
Showing with 9 additions and 14 deletions.
  1. +2 −4 django/core/serializers/base.py
  2. +4 −5 django/core/serializers/json.py
  3. +3 −5 django/core/serializers/pyyaml.py
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):
"""

0 comments on commit 56bbe0a

Please sign in to comment.