> From: "Alin Serdean" <[email protected]>
> To: [email protected], "Alin Balutoiu" <[email protected]>
> Cc: "Terry Wilson" <[email protected]>, "Lance Richardson" 
> <[email protected]>, "Russell Bryant" <[email protected]>
> Sent: Monday, August 14, 2017 8:45:01 PM
> Subject: [openvswitch 2.8.90] testsuite: 537 539 541 545 765 767 1966 1968 
> 1975 1977 1984 1986 1993 1995 2001 2002
> 2003 2004 2006 2011 2013 2020 2022 2029 2031 2038 2040 2047 2049 2056 2058 
> 2065 2067 2074 2076 2083 2085 2092 2094
> 2101 2103 2110 2112 2119 2121 2128
> 
> To: <[email protected]>
>    Subject: [openvswitch 2.8.90] testsuite: 537 539 541 545 765 767 1966 1968
>    1975 1977 1984 1986 1993 1995 2001 2002 2003 2004 2006 2011 2013 2020
>    2022 2029 2031 2038 2040 2047 2049 2056 2058 2065 2067 2074 2076 2083
>    2085 2092 2094 2101 2103 2110 2112 2119 2121 2128 2130 2136 2138 2140
>    2148 2151 2238 2244 2247 2250 failed
> 
> After patch:
> https://github.com/openvswitch/ovs/commit/e7164d96bcbcf79044a93f6e7acc68f05d8e3945
> a lot of the python3 tests are failing.
> 
> This is probably due to:
> +Traceback (most recent call last):
> +  File "../.././appctl.py", line 75, in <module>
> +    main()
> +  File "../.././appctl.py", line 60, in main
> +    err_no, error, result = client.transact(args.command, args.argv)
> +  File "c:\ovs\python\ovs\unixctl\client.py", line 39, in transact
> +    error, reply = self._conn.transact_block(request)
> +  File "c:\ovs\python\ovs\jsonrpc.py", line 326, in transact_block
> +    error, reply = self.recv_block()
> +  File "c:\ovs\python\ovs\jsonrpc.py", line 309, in recv_block
> +    error, msg = self.recv()
> +  File "c:\ovs\python\ovs\jsonrpc.py", line 273, in recv
> +    data = data.decode('utf-8')
> +AttributeError: 'str' object has no attribute 'decode'
> 
> Also using UTF-8 strings in Windows shells proves to be a bit of challenge.
> 
> Me and @Alin Balutoiu are looking over changes needed on the Windows side as
> well.
> 
> Since Python isn't quite my cup of tea I would like if you can oversee the
> patches that he will send out.
> 
> Thanks,
> Alin.
> 

Hi Alin,

It seems that for the Python3 non-windows, self.stream.recv() returns 
socket.recv(),
which always has a type of "bytes". For the windows case, self.stream.recv() 
returns
get_decoded_buffer(recvBuffer) from python/ovs/winutils.py, which does:

   return bytes(recvBuffer).decode("utf-8")

So for the windows Python3 case, the type of the value returned by 
self.stream.recv()
will always be "str".

I'm not sure why the windows case needs to do the utf-8 decode at the stream 
layer,
but it would be nice if self.stream.recv() returned a consistent type that was
independent of the OS.

I'm happy to help, but I will be travelling tomorrow and will probably not be
able to look any deeper until Wednesday.

I don't know if such a thing exists, but e.g. a Vagrant setup that could build
ovs and run the tests would be a huge help in avoiding this kind of breakage 
(just
a thought...)

Regards,

   Lance
_______________________________________________
discuss mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to