Repository navigation
Nexus: Handle pickle protocols between python versions - #4385
Merged
Merged
Conversation
prckent
requested changes
Jan 6, 2023
prckent
left a comment
Contributor
There was a problem hiding this comment.
Please add exception handling on the pickle5 import and print a message about why it is needed if the import fails.
The mixed python situation is fairly common. e.g. Old system python, user installed recent python.
Contributor
|
While tweaking this code, add some error handling on the open call? Or is the file always guaranteed to be there and readable at this point? |
Contributor
Author
|
Import error exception is added, please check. File is always guaranteed to be there and readable per nexus workflows. |
prckent
approved these changes
Jan 7, 2023
prckent
left a comment
Contributor
There was a problem hiding this comment.
LGTM
I tweaked the message since there are many ways to install python modules and pip might not be the relevant one.
Contributor
|
Test this please |
ye-luo
approved these changes
Jan 8, 2023
ye-luo
enabled auto-merge
January 8, 2023 15:31
Contributor
|
Test this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Handles the pickle (https://docs.python.org/3/library/pickle.html) protocol differences that can arise due to using different python versions, (such as using multiple computers having different python versions, but sharing the same filesystem). In the current code, if python 3.8 is used to generate pickle (.p) files, nexus uses protocol 5. If python 3.7 is used to rerun the same script, protocol 5 is not accessible in that python version (https://docs.python.org/3/library/pickle.html#data-stream-format)
What type(s) of changes does this code introduce?
Does this introduce a breaking change?
What systems has this change been tested on?
Andes, Summit
Checklist
Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.