TypeError when using version 1.0.0 with psycopg2

Issue #53 resolved
Anonymous created an issue

Related thread: https://github.com/YPlan/gargoyle/issues/82

It appears that django-jsonfield is attempting to parse an already-parsed JSON string based off the error message from the link above:

TypeError: the JSON object must be str, not 'dict'

Comments (18)

  1. Matthew Schinckel repo owner

    Hmm. This is not as simple as it may appear.

    Post-beta versions of postgres that had JSONB support also allowed a valid JSON string to be stored in a JSON column, rather than requiring an object or array.

    This means we can't just parse-the-string-if-its-a-string.

    I wonder if it should be parse the string if it's not from postgres.

    Can you put together a test case/PR?

  2. C F

    Just going to give you a heads-up that I don't have enough time right now to look into it this further, sorry! We got around the problem by using an older version of django-jsonfield, and that's sufficient enough for us.

  3. Raphaël Hertzog

    On my side, the tests with PG 9.5 were cleary failing (..........EE.E...........EE.E...F.) and after the fix, they were all working. So I would like to have more details about the failure that you see in codeship.

  4. Log in to comment