> From: "Alin Balutoiu" <[email protected]>
> To: [email protected]
> Sent: Monday, August 14, 2017 9:47:15 PM
> Subject: [ovs-dev] [PATCH 2/2] python: Force file system encoding on cmdline  
> args
> 
> On Windows, the default file system encoding is 'mbcs'
> resulting in a bad conversion.
> 
> To make it cross-platform tolerant use
> 'sys.getfilesystemencoding()' instead of 'utf-8'.
> 
> 
> Co-authored-by: Alin Serdean <[email protected]>
> Signed-off-by: Alin Balutoiu <[email protected]>
> Signed-off-by: Alin Serdean <[email protected]>
> ---
>  tests/test-ovsdb.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py
> index df9d6d5..fc42a2d 100644
> --- a/tests/test-ovsdb.py
> +++ b/tests/test-ovsdb.py
> @@ -337,7 +337,8 @@ def idl_set(idl, commands, step):
>                  if six.PY2:
>                      s.s = args[2].decode('utf-8')
>                  else:
> -                    s.s = args[2].encode('utf-8', 'surrogateescape') \
> +                    s.s = args[2].encode(sys.getfilesystemencoding(),
> +                                         'surrogateescape') \
>                                   .decode('utf-8', 'replace')
>              elif args[1] == "u":
>                  s.u = uuid.UUID(args[2])
> --
> 2.10.0.windows.1
> _______________________________________________

LGTM, tests pass under Linux.

Acked-by: Lance Richardson <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to