From 5b36e4ef5ebfa160ca9a9f758748c8e20e9cec05 Mon Sep 17 00:00:00 2001 From: Guillermo Manzato Date: Sat, 25 Oct 2014 15:35:00 -0300 Subject: [PATCH] Use OSError.strerror instead of (inexistent) OSError.msg --- tools/roslaunch/src/roslaunch/nodeprocess.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/roslaunch/src/roslaunch/nodeprocess.py b/tools/roslaunch/src/roslaunch/nodeprocess.py index 441d0375e8..2b641d2e86 100644 --- a/tools/roslaunch/src/roslaunch/nodeprocess.py +++ b/tools/roslaunch/src/roslaunch/nodeprocess.py @@ -215,7 +215,7 @@ def _configure_logging(self): if e.errno == 13: raise RLException("unable to create directory for log file [%s].\nPlease check permissions."%log_dir) else: - raise RLException("unable to create directory for log file [%s]: %s"%(log_dir, e.msg)) + raise RLException("unable to create directory for log file [%s]: %s"%(log_dir, e.strerror)) # #973: save log dir for error messages self.log_dir = log_dir @@ -290,18 +290,18 @@ def start(self): self.popen = subprocess.Popen(self.args, cwd=cwd, stdout=logfileout, stderr=logfileerr, env=full_env, close_fds=True, preexec_fn=os.setsid) except OSError as e: self.started = True # must set so is_alive state is correct - _logger.error("OSError(%d, %s)", e.errno, e.msg) - if errno == 8: #Exec format error + _logger.error("OSError(%d, %s)", e.errno, e.strerror) + if e.errno == 8: #Exec format error raise FatalProcessLaunch("Unable to launch [%s]. \nIf it is a script, you may be missing a '#!' declaration at the top."%self.name) - elif errno == 2: #no such file or directory + elif e.errno == 2: #no such file or directory raise FatalProcessLaunch("""Roslaunch got a '%s' error while attempting to run: %s Please make sure that all the executables in this command exist and have -executable permission. This is often caused by a bad launch-prefix."""%(msg, ' '.join(self.args))) +executable permission. This is often caused by a bad launch-prefix."""%(e.strerror, ' '.join(self.args))) else: - raise FatalProcessLaunch("unable to launch [%s]: %s"%(' '.join(self.args), msg)) + raise FatalProcessLaunch("unable to launch [%s]: %s"%(' '.join(self.args), e.strerror)) self.started = True # Check that the process is either still running (poll returns