Re: django.utils.simplejson + stdlib json

2013-04-13 Thread Alex Ogier
This problem was gonna have to be eventually sorted through no matter what:
the endgame was decided to be "json from the standard library everywhere"
which means any projects doing simplejson.dumps([django internals]) would
inevitably be affected sooner or later. In theory it's just as distasteful
and wrong to perform simplejson.dumps(, cls=json.JSONEncoder) as it is
to perform json.dumps(, cls=simplejson.JSONEncoder), however due to the
practical concern that for the time being the latter works and the former
doesn't, it might have been worth keeping a shim specifically when
subclassing JSONEncoder. Of course, there's no guarantee that future
releases of simplejson won't make the latter every bit as broken, and
eventually Django core is going to require that everyone who uses Django
internals use json instead of simplejson anyways, so it's of dubious
benefit, and I don't think it's worth re-adding.

Best,
Alex Ogier


On Sat, Apr 13, 2013 at 5:34 PM, Aymeric Augustin <
aymeric.augus...@polytechnique.org> wrote:

> On 13 avr. 2013, at 22:13, Jeremy Dunck  wrote:
>
> > After reading that ticket, I'm not sure what Alex and I are
> > disagreeing on.  I was suggesting using django.utils.simplejson
> > internally until it's removed, so that at least people could be
> > consistent with django itself.  That way, DjangoJSONEncoder would be a
> > simplejson.JSONEncoder (if simplejson is installed) until we remove
> > the shim.
>
> I see — I hadn't understood that you were proposing this.
>
> > Anyway, since we've already deprecated utils.simplejson, since we've
> > already done the damage here, and since doing a release to fix this is
> > probably not going to help that many people (they've either already
> > fixed their backwards-incompat or aren't planning on going to 1.5 any
> > time soon)... maybe I agree we should leave it alone.
>
>
> Yes, maybe we could have handled this differently, but at this point the
> cure would be worse than the disease :|
>
> --
> Aymeric.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.utils.simplejson + stdlib json

2013-04-13 Thread Aymeric Augustin
On 13 avr. 2013, at 22:13, Jeremy Dunck  wrote:

> After reading that ticket, I'm not sure what Alex and I are
> disagreeing on.  I was suggesting using django.utils.simplejson
> internally until it's removed, so that at least people could be
> consistent with django itself.  That way, DjangoJSONEncoder would be a
> simplejson.JSONEncoder (if simplejson is installed) until we remove
> the shim.

I see — I hadn't understood that you were proposing this.

> Anyway, since we've already deprecated utils.simplejson, since we've
> already done the damage here, and since doing a release to fix this is
> probably not going to help that many people (they've either already
> fixed their backwards-incompat or aren't planning on going to 1.5 any
> time soon)... maybe I agree we should leave it alone.


Yes, maybe we could have handled this differently, but at this point the
cure would be worse than the disease :|

-- 
Aymeric.


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.utils.simplejson + stdlib json

2013-04-13 Thread Jeremy Dunck
After reading that ticket, I'm not sure what Alex and I are
disagreeing on.  I was suggesting using django.utils.simplejson
internally until it's removed, so that at least people could be
consistent with django itself.  That way, DjangoJSONEncoder would be a
simplejson.JSONEncoder (if simplejson is installed) until we remove
the shim.

I agree w/ deprecating utils.simplejson, and I agree that leaky shims
are a fundamental problem, but it does seem to me that the state of
play could be better by not using simplejson and json both in the same
codebase.  DjangoJSONEncoder(json.JSONEncoder) but
django.utils.simplejson is simplejson if it's available.

Anyway, since we've already deprecated utils.simplejson, since we've
already done the damage here, and since doing a release to fix this is
probably not going to help that many people (they've either already
fixed their backwards-incompat or aren't planning on going to 1.5 any
time soon)... maybe I agree we should leave it alone.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.utils.simplejson + stdlib json

2013-04-11 Thread Jeremy Dunck
Yes, sorry, am mobile right now. Thanks Mr Ogier. :)

On Apr 11, 2013, at 6:44 PM, Alex Ogier  wrote:

> I think what he is saying is that many third-party libraries call the
> equivalent of django.utils.simplejson.dumps("...",
> cls=DjangoJSONEncoder) which, despite django.utils.simplejson only
> being in a pending deprecation state, is broken.
> 
> On Thu, Apr 11, 2013 at 9:22 PM, Alex Gaynor  wrote:
>> When doing what? What do I need to do to trigger this?
>> 
>> Alex
>> 
>> On Apr 11, 2013 6:16 PM, "Jeremy Dunck"  wrote:
>>> 
>>> If a user of django has simplejson installed, django itself will use both
>>> the stdlib and simplejson.
>>> 
>>> On Apr 11, 2013, at 5:54 PM, Alex Gaynor  wrote:
>>> 
>>> I basically agree with what Bob said on the ticket, it's unclear to me
>>> from your email how this manifests, other than trying to use something from
>>> the standard library with simplejson, which is obviously wrong.
>>> 
>>> Alex
>>> 
>>> 
>>> On Thu, Apr 11, 2013 at 5:51 PM, Jeremy Dunck  wrote:
 
 I've just seen a documented example of this breaking things in the wild.
 
 https://github.com/simplejson/simplejson/issues/37
 
 I think we broke backwards-compat here - django 1.5.1. plus sentry
 5.4.5 dies because django's own DjangoJSONEncoder depends on stdlib
 json, but sentry (and lots of things) use django.utils.simplejson,
 which uses simplejson if available.
 
 Unfortunately, this is incompatible - we kept utils.simplejson as a
 compat shim, but I think until it goes away, we should keep using it
 internally as well.
 
 Alternatives?
 
 --
 You received this message because you are subscribed to the Google Groups
 "Django developers" group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to django-developers+unsubscr...@googlegroups.com.
 To post to this group, send email to django-developers@googlegroups.com.
 Visit this group at
 http://groups.google.com/group/django-developers?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
>>> 
>>> 
>>> 
>>> --
>>> "I disapprove of what you say, but I will defend to the death your right
>>> to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
>>> "The people's good is the highest law." -- Cicero
>>> GPG Key fingerprint: 125F 5C67 DFE9 4084
>>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to django-developers+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-developers@googlegroups.com.
>>> Visit this group at
>>> http://groups.google.com/group/django-developers?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>> 
>>> 
>>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to django-developers+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-developers@googlegroups.com.
>>> Visit this group at
>>> http://groups.google.com/group/django-developers?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>> 
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.utils.simplejson + stdlib json

2013-04-11 Thread Alex Ogier
I think what he is saying is that many third-party libraries call the
equivalent of django.utils.simplejson.dumps("...",
cls=DjangoJSONEncoder) which, despite django.utils.simplejson only
being in a pending deprecation state, is broken.

On Thu, Apr 11, 2013 at 9:22 PM, Alex Gaynor  wrote:
> When doing what? What do I need to do to trigger this?
>
> Alex
>
> On Apr 11, 2013 6:16 PM, "Jeremy Dunck"  wrote:
>>
>> If a user of django has simplejson installed, django itself will use both
>> the stdlib and simplejson.
>>
>> On Apr 11, 2013, at 5:54 PM, Alex Gaynor  wrote:
>>
>> I basically agree with what Bob said on the ticket, it's unclear to me
>> from your email how this manifests, other than trying to use something from
>> the standard library with simplejson, which is obviously wrong.
>>
>> Alex
>>
>>
>> On Thu, Apr 11, 2013 at 5:51 PM, Jeremy Dunck  wrote:
>>>
>>> I've just seen a documented example of this breaking things in the wild.
>>>
>>> https://github.com/simplejson/simplejson/issues/37
>>>
>>> I think we broke backwards-compat here - django 1.5.1. plus sentry
>>> 5.4.5 dies because django's own DjangoJSONEncoder depends on stdlib
>>> json, but sentry (and lots of things) use django.utils.simplejson,
>>> which uses simplejson if available.
>>>
>>> Unfortunately, this is incompatible - we kept utils.simplejson as a
>>> compat shim, but I think until it goes away, we should keep using it
>>> internally as well.
>>>
>>> Alternatives?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to django-developers+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-developers@googlegroups.com.
>>> Visit this group at
>>> http://groups.google.com/group/django-developers?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>
>>
>>
>> --
>> "I disapprove of what you say, but I will defend to the death your right
>> to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
>> "The people's good is the highest law." -- Cicero
>> GPG Key fingerprint: 125F 5C67 DFE9 4084
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at
>> http://groups.google.com/group/django-developers?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at
>> http://groups.google.com/group/django-developers?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.utils.simplejson + stdlib json

2013-04-11 Thread Alex Gaynor
When doing what? What do I need to do to trigger this?

Alex
On Apr 11, 2013 6:16 PM, "Jeremy Dunck"  wrote:

> If a user of django has simplejson installed, django itself will use both
> the stdlib and simplejson.
>
> On Apr 11, 2013, at 5:54 PM, Alex Gaynor  wrote:
>
> I basically agree with what Bob said on the ticket, it's unclear to me
> from your email how this manifests, other than trying to use something from
> the standard library with simplejson, which is obviously wrong.
>
> Alex
>
>
> On Thu, Apr 11, 2013 at 5:51 PM, Jeremy Dunck  wrote:
>
>> I've just seen a documented example of this breaking things in the wild.
>>
>> https://github.com/simplejson/simplejson/issues/37
>>
>> I think we broke backwards-compat here - django 1.5.1. plus sentry
>> 5.4.5 dies because django's own DjangoJSONEncoder depends on stdlib
>> json, but sentry (and lots of things) use django.utils.simplejson,
>> which uses simplejson if available.
>>
>> Unfortunately, this is incompatible - we kept utils.simplejson as a
>> compat shim, but I think until it goes away, we should keep using it
>> internally as well.
>>
>> Alternatives?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at
>> http://groups.google.com/group/django-developers?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> --
> "I disapprove of what you say, but I will defend to the death your right
> to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
> "The people's good is the highest law." -- Cicero
> GPG Key fingerprint: 125F 5C67 DFE9 4084
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.utils.simplejson + stdlib json

2013-04-11 Thread Jeremy Dunck
If a user of django has simplejson installed, django itself will use both the 
stdlib and simplejson. 

On Apr 11, 2013, at 5:54 PM, Alex Gaynor  wrote:

> I basically agree with what Bob said on the ticket, it's unclear to me from 
> your email how this manifests, other than trying to use something from the 
> standard library with simplejson, which is obviously wrong.
> 
> Alex
> 
> 
> On Thu, Apr 11, 2013 at 5:51 PM, Jeremy Dunck  wrote:
>> I've just seen a documented example of this breaking things in the wild.
>> 
>> https://github.com/simplejson/simplejson/issues/37
>> 
>> I think we broke backwards-compat here - django 1.5.1. plus sentry
>> 5.4.5 dies because django's own DjangoJSONEncoder depends on stdlib
>> json, but sentry (and lots of things) use django.utils.simplejson,
>> which uses simplejson if available.
>> 
>> Unfortunately, this is incompatible - we kept utils.simplejson as a
>> compat shim, but I think until it goes away, we should keep using it
>> internally as well.
>> 
>> Alternatives?
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> -- 
> "I disapprove of what you say, but I will defend to the death your right to 
> say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
> "The people's good is the highest law." -- Cicero
> GPG Key fingerprint: 125F 5C67 DFE9 4084
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.utils.simplejson + stdlib json

2013-04-11 Thread Alex Gaynor
I basically agree with what Bob said on the ticket, it's unclear to me from
your email how this manifests, other than trying to use something from the
standard library with simplejson, which is obviously wrong.

Alex


On Thu, Apr 11, 2013 at 5:51 PM, Jeremy Dunck  wrote:

> I've just seen a documented example of this breaking things in the wild.
>
> https://github.com/simplejson/simplejson/issues/37
>
> I think we broke backwards-compat here - django 1.5.1. plus sentry
> 5.4.5 dies because django's own DjangoJSONEncoder depends on stdlib
> json, but sentry (and lots of things) use django.utils.simplejson,
> which uses simplejson if available.
>
> Unfortunately, this is incompatible - we kept utils.simplejson as a
> compat shim, but I think until it goes away, we should keep using it
> internally as well.
>
> Alternatives?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django.utils.simplejson + stdlib json

2013-04-11 Thread Jeremy Dunck
I've just seen a documented example of this breaking things in the wild.

https://github.com/simplejson/simplejson/issues/37

I think we broke backwards-compat here - django 1.5.1. plus sentry
5.4.5 dies because django's own DjangoJSONEncoder depends on stdlib
json, but sentry (and lots of things) use django.utils.simplejson,
which uses simplejson if available.

Unfortunately, this is incompatible - we kept utils.simplejson as a
compat shim, but I think until it goes away, we should keep using it
internally as well.

Alternatives?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.