From d0d47c7959f4c5193b767ddea8b0affc25ca40f0 Mon Sep 17 00:00:00 2001 From: Pete Date: Wed, 18 Dec 2019 12:03:17 -0500 Subject: Python3 compatibility updates (#28) * WIP: fix imports and exception calls for python3 * fix remaining utf-8 encoding issues * fix init trying to return a value * change expected control checks to bytes * make comparison of request params non-ordered python3's url request handler likes to reorder the parameters its given this breaks the params out and checks each separately * refactor to simplify params comparisons * FIX: decode auth bytes back to a utf-8 string * FIX: also decode response data bytes to utf-8 * FIX: do not decode response data if already a str * enhance existing test to ensure auth is str no bytes * change test req and import from mox to mox3 * add additional python versions to CI config * fix failing 3.7 travis ci build * Apply changes to duo_openvpn.py similar to what we do in duo_client_python * Apply changes to https_wrapper similar to what we do in duo_client_python * Fixup the import bugs * Use six for StringIO import * Include six for py2->py3 compat layer * use explicit decoding on control file data * Consistent encoding and updated variable names for clarity * Revert variable names back again. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2481c83..b83ed6e 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ install: duo_openvpn.so ifdef USE_PERL install -c duo_openvpn.pl -m 755 $(DESTDIR)$(PREFIX) else - install -c duo_openvpn.py https_wrapper.py -m 755 $(DESTDIR)$(PREFIX) + install -c duo_openvpn.py https_wrapper.py six.py -m 755 $(DESTDIR)$(PREFIX) endif uninstall: @@ -32,6 +32,7 @@ uninstall: rm -f $(DESTDIR)$(PREFIX)/duo_openvpn.pl rm -f $(DESTDIR)$(PREFIX)/duo_openvpn.py rm -f $(DESTDIR)$(PREFIX)/https_wrapper.py + rm -f $(DESTDIR)$(PREFIX)/six.py clean: rm -f *.so *.o -- cgit v1.2.3