Comment 54 for bug 1314129

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

Reviewed: https://review.openstack.org/95749
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=1b9018859fa3b420d01ed191b916476db6eb9182
Submitter: Jenkins
Branch: stable/icehouse

commit 1b9018859fa3b420d01ed191b916476db6eb9182
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:
     tests/unit/test_jsonutils.py

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