subprocess call crushes when code is not writable, without much meaningful messge. Test dir writable before run process