fixed a nasty bug in edit.py, when a directory exists but nott the file...