Opening, reading and writing to a file works fine in mod_python, but using fileinput (with inplace editing) gives me a 'permission denied' with exactly the same fileName: ========================= fileinput.input(fileName, inplace=1) ========================= I suspect that this has to do with the temporary file it creates, or am I wrong?