Skip to content

Commit ac87142

Browse files
committed
fix: set default to false, str2bool, join traceback list
1 parent 7d1c76e commit ac87142

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

nipype/pipeline/plugins/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ def report_crash(node, traceback=None, hostname=None):
6868
if not os.path.exists(crashdir):
6969
os.makedirs(crashdir)
7070
crashfile = os.path.join(crashdir, crashfile)
71-
if node.config['execution']['text_crashfiles']:
71+
if str2bool(node.config['execution']['text_crashfiles']):
7272
crashfile += '.txt'
7373
else:
7474
crashfile += '.pklz'
7575
logger.info('Saving crash info to %s' % crashfile)
7676
logger.info(''.join(traceback))
77-
if node.config['execution']['text_crashfiles']:
78-
crash_to_txt(crashfile, dict(node=node, traceback=traceback))
77+
if str2bool(node.config['execution']['text_crashfiles']):
78+
crash2txt(crashfile, dict(node=node, traceback=traceback))
7979
else:
8080
savepkl(crashfile, dict(node=node, traceback=traceback))
8181
return crashfile

nipype/utils/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
remove_unnecessary_outputs = true
5656
try_hard_link_datasink = true
5757
single_thread_matlab = true
58-
text_crashfiles = true
58+
text_crashfiles = false
5959
stop_on_first_crash = false
6060
stop_on_first_rerun = false
6161
use_relative_paths = false

nipype/utils/filemanip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def crash2txt(filename, record):
540540
fp.write('Working directory: {}\n'.format(node.output_dir()))
541541
fp.write('\n')
542542
fp.write('Node inputs:\n{}\n'.format(node.inputs))
543-
fp.write(record['traceback'])
543+
fp.write(''.join(record['traceback']))
544544

545545

546546
def savepkl(filename, record):

0 commit comments

Comments
 (0)