Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 905 by akaihola: can't load siteconfig data from fixtures

What steps will reproduce the problem?
>>> from djblets.siteconfig.models import SiteConfiguration
>>> s=SiteConfiguration(site_id=1)
>>> s.set('mykey', 'myvalue')

$ ./ dumpdata siteconfig --indent=2 | tee /tmp/siteconfig.json
     "pk": 1,
     "model": "siteconfig.siteconfiguration",
     "fields": {
       "version": "",
       "site": 1,
       "settings": "{u'mykey': u'myvalue'}"

$ ./ loaddata /tmp/siteconfig.json

What is the expected output? What do you see instead?

Should load the fixture as expected. Spits the following traceback instead:

Installing json fixture '/tmp/siteconfig' from '/tmp/siteconfig'.
Problem installing fixture '/tmp/siteconfig.json': Traceback (most recent
call last):
   File "django/core/management/commands/", line 150, in handle
     for obj in objects:
   File "django/core/serializers/", line 41, in Deserializer
     for obj in PythonDeserializer(simplejson.load(stream)):
   File "django/core/serializers/", line 96, in Deserializer
     yield base.DeserializedObject(Model(**data), m2m_data)
   File "djblets/siteconfig/", line 54, in __init__
     models.Model.__init__(self, *args, **kwargs)
   File "django/db/models/", line 266, in __init__
     signals.post_init.send(sender=self.__class__, instance=self)
   File "django/dispatch/", line 148, in send
     response = receiver(signal=self, sender=sender, **named)
   File "djblets/util/", line 159, in post_init
     value = self.loads(value)
   File "djblets/util/", line 169, in loads
     val = simplejson.loads(s, encoding=settings.DEFAULT_CHARSET)
   File "django/utils/simplejson/", line 343, in loads
     return cls(encoding=encoding, **kw).decode(s)
   File "django/utils/simplejson/", line 326, in decode
     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
   File "django/utils/simplejson/", line 342, in raw_decode
     obj, end = self.scan_once(s, idx)
   File "django/utils/simplejson/", line 36, in _scan_once
     return parse_object((string, idx + 1), encoding, strict, _scan_once,
   File "django/utils/simplejson/", line 153, in JSONObject
     raise ValueError(errmsg("Expecting property name", s, end))
ValueError: Expecting property name: line 1 column 1 (char 1)

I trimmed source file paths in the traceback for clarity. Using XML as the
serialization format gives a similar traceback.

What operating system are you using? What browser?

Ubuntu Intrepid 8.10, Python 2.5.2, Django trunk @9825.

You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to