Fixed #7990 -- Modified serializers to use StringIO, rather than cStringIO, due to potential unicode issues.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8151 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2008-07-30 10:40:37 +00:00
parent 4454bde3c1
commit 56bbe0aa46
3 changed files with 9 additions and 14 deletions

View File

@ -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 File

@ -3,14 +3,13 @@ Serialize data to/from JSON
"""
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 File

@ -4,14 +4,12 @@ YAML serializer.
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):
"""