Comment 64 for bug 1314129

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to oslo-incubator (stable/havana)

Reviewed: https://review.openstack.org/95753
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=6a290f5dedcc00538c12e7b1e3a2374ea48919c0
Submitter: Jenkins
Branch: stable/havana

commit 6a290f5dedcc00538c12e7b1e3a2374ea48919c0
Author: Ihar Hrachyshka <email address hidden>
Date: Wed Apr 30 14:53:15 2014 +0200

    Enforce unicode json output for jsonutils.load[s]()

    simplejson module applies some optimizations on ASCII-only unicode
    strings which result in non-unicode json output. See details at [1]
    and [2]. To make sure we always return consistent json output no
    matter which json implementation is used, we should explicitly convert
    the input for json.load[s]() to unicode.

    If user wants to pass a file object of non UTF-8 encoding to
    json.load[s](), she must also specify this encoding as an argument. To
    support this scenario too, we've added 'encoding' argument to
    jsonutils.load[s]() implementation.

    Made all present JSON tests to run on both supported json library
    implementations.

    Added explicit dependency for simplejson to be able to test different
    implementations in unit tests. Distributors still running Python 2.6
    are recommended but not required to install simplejson.

    Related-Bug: 1314129

    [1]: https://code.djangoproject.com/ticket/11742
    [2]: https://code.google.com/p/simplejson/issues/detail?id=40

    Conflicts:
     test-requirements-py3.txt
     tests/unit/test_jsonutils.py

    Change-Id: Ic815ca3df94c33edec9104172048b2cd94b92e3f
    (cherry picked from commit 18f2bc1bf080b41a22c70842e7c127da21c63b8b)