[ovs-dev] [PATCH] python: make python idl unicode-tolerant

Russell Bryant russell at ovn.org
Wed Aug 9 19:27:32 UTC 2017


On Tue, Aug 8, 2017 at 2:44 PM, Lance Richardson <lrichard at redhat.com> wrote:
> Ensure that JSON is utf-8 encoded and that bytes sent/received on
> the stream sockets are in utf-8 form. Add a test case to verify
> that unicode column data can be sent/received successfully using
> Python module.
>
> JSON encoder magic to ensure utf-8 encoding  suggested by Terry
> Wilson.
>
> Suggested-by: Terry Wilson <twilson at redhat.com>
> Signed-off-by: Lance Richardson <lrichard at redhat.com>
> ---
>  python/ovs/json.py    |  9 +++++++--
>  python/ovs/jsonrpc.py |  3 +--
>  python/ovs/stream.py  |  6 ++++--
>  tests/ovsdb-idl.at    | 13 +++++++++++++
>  tests/test-ovsdb.py   |  5 ++++-
>  5 files changed, 29 insertions(+), 7 deletions(-)

We discussed this patch on IRC, but for the record:

There's a line in test-ovsdb.py that's too long.  flake8 complained
about it for me.

The changes to ovsdb-idl.at contain some unicode that my terminal
chokes on.  After spending far too much time trying to figure out why,
I was able to work around it by changing the crazy face to an
appropriate alternative which seems to work OK: (╯°□°)╯︵ ┻━┻


More information about the dev mailing list