spark fixes for python3