At Wed, 24 Jun 2015 14:05:18 +0900,
fumihiko kakuma wrote:
> 
> This is the partial patch to supporting python 3.
> unicode was removed in python 3. So we use six.text_type instead of unicode.
> 
> Signed-off-by: Fumihiko Kakuma <[email protected]>
> ---
>  ryu/lib/ovs/vsctl.py                           |  3 ++-
>  ryu/lib/stringify.py                           | 11 ++++++-----
>  ryu/ofproto/ofproto_v1_2_parser.py             |  3 ++-
>  ryu/ofproto/ofproto_v1_3_parser.py             |  3 ++-
>  ryu/ofproto/ofproto_v1_4_parser.py             |  3 ++-
>  ryu/ofproto/ofproto_v1_5_parser.py             |  3 ++-
>  ryu/services/protocols/bgp/operator/command.py |  3 ++-
>  ryu/services/protocols/bgp/utils/logs.py       |  3 ++-
>  ryu/tests/switch/tester.py                     |  3 ++-
>  9 files changed, 22 insertions(+), 13 deletions(-)

> diff --git a/ryu/lib/stringify.py b/ryu/lib/stringify.py
> index 816c7a0..3c5bf5e 100644
> --- a/ryu/lib/stringify.py
> +++ b/ryu/lib/stringify.py

> @@ -186,7 +187,7 @@ class StringifyMixin(object):
>      @classmethod
>      def _get_default_encoder(cls, encode_string):
>          def _encode(v):
> -            if isinstance(v, (bytes, unicode)):
> +            if isinstance(v, (bytes, six.text_type)):
>                  json_value = encode_string(v)

This fix is incomplete as encode_string(==b64encode) doesn't take
six.text_type in python3.

My idea is to file another patch after this patch is merged, though.

>              elif isinstance(v, list):
>                  json_value = map(_encode, v)

--
IWAMOTO Toshihiro

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to