#16850: Testsuite failing on JSON serialization
-------------------------------------+-------------------------------------
 Reporter:  Raphael Hertzog          |          Owner:  nobody
  <hertzog@…>                        |         Status:  new
     Type:  Bug                      |      Component:  Core
Milestone:                           |  (Serialization)
  Version:  1.3                      |       Severity:  Normal
 Keywords:                           |   Triage Stage:  Unreviewed
Has patch:  0                        |  Easy pickings:  0
    UI/UX:  0                        |
-------------------------------------+-------------------------------------
 Trying to build Django 1.3.1 on Debian unstable with python 2.6 and
 python-simplejson 2.2.0 installed I get two test suite failures.

 Without python-simplejson

 {{{
 ======================================================================
 ERROR: test_serialize_unicode
 (modeltests.serializers.tests.JsonSerializerTestCase)
 Tests that unicode makes the roundtrip intact
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/tests/modeltests/serializers/tests.py", line 172, in
 test_serialize_unicode
     obj_list = list(serializers.deserialize(self.serializer_name,
 serial_str))
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/django/core/serializers/json.py", line 35, in Deserializer
     for obj in PythonDeserializer(simplejson.load(stream), **options):
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/django/core/serializers/python.py", line 128, in Deserializer
     data[field.name] = field.to_python(field_value)
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/django/db/models/fields/__init__.py", line 761, in to_python
     return decimal.Decimal(value)
   File "/usr/lib/python2.6/decimal.py", line 649, in __new__
     "First convert the float to a string")
 TypeError: Cannot convert float to Decimal.  First convert the float to a
 string

 ======================================================================
 ERROR: test_json_serializer
 (regressiontests.serializers_regress.tests.SerializerTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/django/utils/functional.py", line 55, in _curried
     return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/tests/regressiontests/serializers_regress/tests.py", line
 373, in serializerTest
     for obj in serializers.deserialize(format, serialized_data):
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/django/core/serializers/json.py", line 35, in Deserializer
     for obj in PythonDeserializer(simplejson.load(stream), **options):
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/django/core/serializers/python.py", line 128, in Deserializer
     data[field.name] = field.to_python(field_value)
   File "/home/rhertzog/deb/pkg/TEAMS/build-area/python-
 django-1.3.1/django/db/models/fields/__init__.py", line 761, in to_python
     return decimal.Decimal(value)
   File "/usr/lib/python2.6/decimal.py", line 649, in __new__
     "First convert the float to a string")
 TypeError: Cannot convert float to Decimal.  First convert the float to a
 string
 }}}

 I also filed https://github.com/simplejson/simplejson/issues/17 because
 I'm not sure whether Django is improperly using simplejson or whether
 simplejson has a bug.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16850>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to