Re: [Django] #16850: Testsuite failing on JSON serialization

2017-05-20 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
 Reporter:  Raphael Hertzog  |Owner:  nobody
  |
 Type:  Bug  |   Status:  closed
Component:  Core |  Version:  1.3
  (Serialization)|
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"3e9aa298719f19d5f09dbe0df29b6bb8d2136229" 3e9aa298]:
 {{{
 #!CommitTicketReference repository=""
 revision="3e9aa298719f19d5f09dbe0df29b6bb8d2136229"
 Refs #16850 -- Removed obsolete simplejson support in JSON serializer.

 cpython's json version is 2.0.9 so this line is never used.
 }}}

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/094.73bfc8bbd385d23cd4489263ceda4075%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #16850: Testsuite failing on JSON serialization

2011-12-17 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
 Reporter:  Raphael Hertzog  |Owner:  nobody
  |   Status:  closed
 Type:  Bug  |  Version:  1.3
Component:  Core |   Resolution:  fixed
  (Serialization)| Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by ramiro):

 In [17229]:
 {{{
 #!CommitTicketReference repository="" revision="17229"
 Tweaked changes from r17228 to cater for older simplejson versions.

 dump() started accepting the `use_decimal` argument in 2.1.3.

 Refs #16850.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16850: Testsuite failing on JSON serialization

2011-12-17 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
 Reporter:  Raphael Hertzog  |Owner:  nobody
  |   Status:  closed
 Type:  Bug  |  Version:  1.3
Component:  Core |   Resolution:  fixed
  (Serialization)| Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by ramiro):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [17228]:
 {{{
 #!CommitTicketReference repository="" revision="17228"
 Fixed #16850 -- Made sure we always represent Decimal instances with JS
 strings when serializing.

 We force this when calling simplejson dump() to isolate us from changes of
 default behavior to encode them with JavaScript numbers instead that could
 introduce loss of precision when decoding back from JSON to Python.

 Thanks Raphael Hertzog for the report and Bob Ippolito for his help.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16850: Testsuite failing on JSON serialization

2011-12-17 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
 Reporter:  Raphael Hertzog  |Owner:  nobody
  |   Status:  new
 Type:  Bug  |  Version:  1.3
Component:  Core |   Resolution:
  (Serialization)| Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by ramiro):

 Replying to [comment:4 ramiro]:
 > There is something strange in the fact that testing things with Python
 2.7 (I also use Debian unstable, Python 2.7 has recently entered Sid) and
 the same simplejson 2.2.0 version (provided by debian python-simplejson
 DEB package) doesn't show these failures.
 >
 > Just to be sure, I ran the serializers tests with Python 2.6 in the same
 system and I see the reported failures.
 >
 > Maybe Python 2.6 also has something to do with this?

 The reason for this is because additionally the version of Decimal shipped
 with Python 2.7 has a new `Decimal.from_float()` method that gets used
 during decoding from JSON operations instead or raising the error reported
 with Python 2.6 by the OP. This method can lose precision and neither we
 nor simplejson can control that.

 This seems to be an additional reason to keep using strings to encode
 Decimal's

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16850: Testsuite failing on JSON serialization

2011-10-18 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
 Reporter:  Raphael Hertzog  |Owner:  nobody
  |   Status:  new
 Type:  Bug  |  Version:  1.3
Component:  Core |   Resolution:
  (Serialization)| Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by ramiro):

 There is something strange in the fact that testing things with Python 2.7
 (I'm also use Debian unstable and Python 2.7 has recently entered Sid) and
 the same simplejson 2.2.0 version (provided by debian python-simplejson
 DEB package) doesn't show these failures.

 Just to be sure I ran the serializers tsts with Python 2.6 in the same
 system and I see the reported failures.

 Maybe Python 2.6 has also something to do with this?

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16850: Testsuite failing on JSON serialization

2011-09-15 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
   Reporter:  Raphael|  Owner:  nobody
  Hertzog | Status:  new
   Type:  Bug|  Component:  Core
  Milestone: |  (Serialization)
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Accepted   |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
Changes (by carljm):

 * stage:  Unreviewed => Accepted


Comment:

 We should just use that use_decimal=False option, then. I don't see a
 compelling case for changing the dumped output to use numbers instead of
 strings for decimals, given that it can lose precision in the round-trip.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16850: Testsuite failing on JSON serialization

2011-09-15 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
   Reporter:  Raphael|  Owner:  nobody
  Hertzog | Status:  new
   Type:  Bug|  Component:  Core
  Milestone: |  (Serialization)
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-

Comment (by Raphaël Hertzog ):

 Note that the comment above was made by the simplejson author/maintainer
 (see
 https://github.com/simplejson/simplejson/issues/17#issuecomment-2105920).

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16850: Testsuite failing on JSON serialization

2011-09-15 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
   Reporter:  Raphael|  Owner:  nobody
  Hertzog | Status:  new
   Type:  Bug|  Component:  Core
  Milestone: |  (Serialization)
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by anonymous):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 It looks like the problem here is that Django expects that decimal objects
 will get converted to string (by its default method) instead of a JSON
 number. This change to the default options was made for usability reasons
 in simplejson 2.2.0, most people want decimals to get encoded as numbers
 even though there's a possible loss of precision if decoded on the other
 end without the right options. This behavior can be turned back off with
 use_decimal=False on encode. The version embedded in Django also supports
 this option (default False rather than True), so explicitly specifying
 this behavior would be compatible with whichever version of dump/dumps
 ends up getting used.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #16850: Testsuite failing on JSON serialization

2011-09-15 Thread Django
#16850: Testsuite failing on JSON serialization
-+-
 Reporter:  Raphael Hertzog  |  Owner:  nobody
  | 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: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.