Rerun in temp directory fails because dir name too long

nipypclicrash -i -r crashfile.pklz fails with an error about inability to create the directory. even if I use the -w flag, it still is trying to create a mammothly long filepath to rerun the node under the specified -w location. How can I avoid this?

If your paths are too long, setting the config['execution']['parameterize_dirs'] option to False will replace paths of >32character with their hash. You may need to rerun the workflow and obtain the new crashfile first

I use that option already. Is there anyway to make the crash file rerun also know to hash its working directory?

@Gregory_Ciccarelli looks like it’s manually set, but it should be an argument that defaults to /tmp if nothing is assigned. Would you want to take a stab at this change?

EDIT: actually, I think the directory argument serves this purpose

Exactly- except that within that directory it seems to be trying to make sub directories still, -w just changes the root from /tmp to /my/path/

Solution from @satra

Load the crashfile itself as a variable in a jupyter notebook or some other python terminal. Then, change the work dir of the node (which in my case wasn’t necessary), and then rerun.

from nipype.utils.filemanip import loadpkl
crashinfo = loadpkl(cpath)
crashinfo['node'].run() # re-creates the crash

Note the latest nipype read the docs manual March 22, 2017 refers to filemanip.loadflat for loading, but my install of nipype couldn’t find that. I might need to upgrade.

pg 19, pdf pg 45, “debugging”