PY3: read+write files must use mode 'r+'