Permalink
Browse files

Backport PR #2437: don't let log cleanup prevent engine start

closes #2435
  • Loading branch information...
1 parent 9066599 commit e773c5385d231d0a8e92402d33c3146b0a20c7c6 @minrk minrk committed with Oct 11, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 IPython/parallel/apps/baseapp.py
@@ -170,8 +170,13 @@ def reinit_logging(self):
log_dir = self.profile_dir.log_dir
if self.clean_logs:
for f in os.listdir(log_dir):
- if re.match(r'%s-\d+\.(log|err|out)'%self.name,f):
- os.remove(os.path.join(log_dir, f))
+ if re.match(r'%s-\d+\.(log|err|out)' % self.name, f):
+ try:
+ os.remove(os.path.join(log_dir, f))
+ except (OSError, IOError):
+ # probably just conflict from sibling process
+ # already removing it
+ pass
if self.log_to_file:
# Start logging to the new log file
log_filename = self.name + u'-' + str(os.getpid()) + u'.log'

0 comments on commit e773c53

Please sign in to comment.