Egad fails ungracefully if the output directory already exists

Bug #493451 reported by Francis Bond
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Egad
Fix Committed
Undecided
Unassigned

Bug Description

If you have already created the output directory (maybe as a result of an interrupted run) then Egad crashes.

A warning and offer to change the directory name would be more friendly.

~$ python bzr/egad/Egad.py treebank/egad/jacy/090705/egad.xml
Traceback (most recent call last):
  File "bzr/egad/Egad.py", line 73, in <module>
    main()
  File "bzr/egad/Egad.py", line 70, in main
    instance = EgadCLI(job)
  File "bzr/egad/Egad.py", line 10, in __init__
    self.process_job(job)
  File "/home/bond/bzr/egad/egad/core.py", line 28, in process_job
    os.makedirs(output_dir)
  File "/usr/lib/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/home/bond/treebank/egad/jacy/090705/egad

Revision history for this message
Michael Wayne Goodman (goodmami) wrote :

Fixed in r12.

Egad now prompts if you want to overwrite the directory. If yes, the existing directory will be deleted and a new one will be created. Be careful not to overwrite directories you don't want to lose.

Alternatively, you can run Egad with the -F or --overwrite flags, thus avoiding the prompt, and forcing Egad to overwrite if necessary.

Changed in egad:
status: New → Fix Committed
Revision history for this message
Michael Wayne Goodman (goodmami) wrote :

oops. r12 actually broke something (I moved a variable declaration and import into a function, and they fell out of scope in the main function). This is fixed in r13.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.