#5586: Comments are not allowed in json fixtures
------------------------------------+---------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Component: Serialization
Version: SVN | Resolution:
Keywords: json fixture comment | Stage: Unreviewed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
------------------------------------+---------------------------------------
Changes (by [EMAIL PROTECTED]):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Ok there is a quick workaround, in django/utils/simplejson/decoder.py
In the decode method i filter the javascript comments before treating
them:
{{{
comment_rx = re.compile(r"""
/\* .*? \*/ |
// [^\n\r]*
""",re.S|re.X)
s = comment_rx.sub('',s)
}}}
This is just a workaround for now, since it doesn't address comments in
strings, and it will mess the error message line/column indications.
--
Ticket URL: <http://code.djangoproject.com/ticket/5586#comment:1>
Django Code <http://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
-~----------~----~----~----~------~----~------~--~---