partial port to python3 and cleanup related to execution of pythonTestDirML