Re: [PATCH] test: Fix UTF-8 JSON tests in Python 3

Subject: Re: [PATCH] test: Fix UTF-8 JSON tests in Python 3

Date: Fri, 07 Dec 2012 09:14:36 -0400

To: Austin Clements, notmuch@notmuchmail.org

Cc:

From: David Bremner


Austin Clements <amdragon@MIT.EDU> writes:

> test_expect_equal_json uses json.tool from the system Python.  While
> Python 2 wasn't picky about the encoding of stdin, Python 3 decodes
> stdin strictly according to the environment.  Since we set LC_ALL=C
> for the tests, Python 3's json.tool was assuming stdin would be in
> ASCII and aborting when it couldn't decode the UTF-8 characters from
> some of the JSON tests.  This patch sets the PYTHONIOENCODING
> environment variable to utf-8 when invoking json.tool to override
> Python's default encoding choice.

This looks sensible; marking ready

d

Thread: