Skip to content

FIX: loadpkl failed when pklz file contained versioning info #3017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "remove versioning option from loadpkl"
This reverts commit 56ab01e.
  • Loading branch information
pndni-builder committed Sep 5, 2019
commit a86d1409514625ee6bd6ee47c715e33bcf44aaab
5 changes: 4 additions & 1 deletion nipype/utils/filemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ def loadcrash(infile, *args):
raise ValueError('Only pickled crashfiles are supported')


def loadpkl(infile):
def loadpkl(infile, versioning=False):
"""Load a zipped or plain cPickled file."""
infile = Path(infile)
fmlogger.debug('Loading pkl: %s', infile)
Expand All @@ -700,6 +700,9 @@ def loadpkl(infile):
fmlogger.info('Successfully loaded pkl in compatibility mode.')
# Unpickling problems
except Exception as e:
if not versioning:
raise e

if pkl_metadata and 'version' in pkl_metadata:
from nipype import __version__ as version
if pkl_metadata['version'] != version:
Expand Down