t/readonly: replace shell script with python script