Don't try to add an existing directory

Bug #487213 reported by Neil Martinsen-Burrell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MCREPOGEN
New
Undecided
Unassigned

Bug Description

Traceback (most recent call last):
      File "./gen_random_history.py", line 166, in <module>
        main()
    Traceback (most recent call last):
      File "./gen_random_history.py", line 166, in <module>
        main()
      File "./gen_random_history.py", line 162, in main
        options.config, options.show_config, options.init_dir) File "./gen_random_history.py", line 133, in generate
        b, t = transition.evolve(revisions, mutators, editors)
      File "/Users/nmb/src/bzr/mcrepogen/mcrepogen/transition.py", line 57, in
evolve tree = transition.step(tree)
      File "/Users/nmb/src/bzr/mcrepogen/mcrepogen/transition.py", line 79, in
step
        tree = mutator.mutate(tree) File "/Users/nmb/src/bzr/mcrepogen/mcrepogen/mutators.py", line 179, in m
utate
        input_tree.add_directory(new_path)
      File "/Users/nmb/src/bzr/mcrepogen/mcrepogen/bzrtreebranch.py", line 190, in add_directory
        os.mkdir(absolute_directory)
    OSError: [Errno 17] File exists: '/private/var/folders/o1/o1uqBGiCHxysyrhc-
DXvGE+++TI/-Tmp-/tmpM5KinK/sopping/jawbone/thoughtlessly'

Fix this by trapping OSError and checking for errno.EEXISTS

Related branches

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.