Skip to content

Commit

Permalink
ticket #824: If we get an OS error doing os.rename of stitcher.log an…
Browse files Browse the repository at this point in the history
…d it is the text windows gives when the file is in use, then exit with a more helpful error message.
  • Loading branch information
ahelsing committed May 20, 2015
1 parent 5b5eb0e commit 2d8813b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ gcf 2.9:
* Bug fix for merging comments when template has a comment child and other does not. (#815)
* Quiet down errors deleting a failed reservation from EG AMs (harmless). (#811)
* Remove reference to ION as a real aggregate in the README. ION has been decommissioned. (#797)
* Gracefully handle error when 2 stitcher instances are running in the same directory
at once on Windows. (#824)

* Scripts
* Initial commit of `examples/renewSliceAndSlivers.py`. (#798)
Expand Down
11 changes: 10 additions & 1 deletion src/stitcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,16 @@ def call(argv, options=None):
if os.path.exists(dfn):
os.remove(dfn)
if os.path.exists(bfn):
os.rename(bfn, dfn)
try:
os.rename(bfn, dfn)
except OSError, e:
# Issue #824 partial solution
if "being used by another process" in str(e):
# On Windows, when another stitcher instance running in same directory, so has stitcher.log open
# WindowsError: [Error 32] The process cannot access the file because it is being used by another process
sys.exit("Error: Is another stitcher process running in this directory? Run stitcher from a different directory, or re-run with the option `--fileDir <separate directory for this run's output files>`")
else:
raise

# Then have Omni configure the logger
try:
Expand Down

0 comments on commit 2d8813b

Please sign in to comment.