Skip to content

Commit 6dcb3c8

Browse files
committed
fix: logging error if % in node cmd
1 parent 8384523 commit 6dcb3c8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nipype/pipeline/engine/nodes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -577,25 +577,25 @@ def _run_command(self, execute, copyfiles=True):
577577
self._originputs = deepcopy(self._interface.inputs)
578578
self._copyfiles_to_wd(execute=execute)
579579

580-
message = '[Node] Running "%s" ("%s.%s")'
580+
message = '[Node] Running "{}" ("{}.{}")'
581581
if issubclass(self._interface.__class__, CommandLine):
582582
try:
583583
cmd = self._interface.cmdline
584584
except Exception as msg:
585-
result.runtime.stderr = '%s\n\n%s' % (
585+
result.runtime.stderr = '{}\n\n{}'.format(
586586
getattr(result.runtime, 'stderr', ''), msg)
587587
_save_resultfile(result, outdir, self.name)
588588
raise
589589
cmdfile = op.join(outdir, 'command.txt')
590590
with open(cmdfile, 'wt') as fd:
591591
print(cmd + "\n", file=fd)
592-
message += ', a CommandLine Interface with command:\n%s' % cmd
593-
logger.info(message, self.name, self._interface.__module__,
594-
self._interface.__class__.__name__)
592+
message += ', a CommandLine Interface with command:\n{}'.format(cmd)
593+
logger.info(message.format(self.name, self._interface.__module__,
594+
self._interface.__class__.__name__))
595595
try:
596596
result = self._interface.run()
597597
except Exception as msg:
598-
result.runtime.stderr = '%s\n\n%s' % (
598+
result.runtime.stderr = '%s\n\n%s'.format(
599599
getattr(result.runtime, 'stderr', ''), msg)
600600
_save_resultfile(result, outdir, self.name)
601601
raise

0 commit comments

Comments
 (0)