Fix safe_copy(..., preserve_meta=False)#4938
Open
samsrabin wants to merge 4 commits intoESMCI:masterfrom
Open
Conversation
The failing test is test_safe_copy_preserve_meta_false: According to the docstring, we do not expect permissions to be preserved when using safe_copy() on a file, but they are.
6023ccd to
672d495
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4938 +/- ##
==========================================
+ Coverage 31.37% 31.51% +0.13%
==========================================
Files 264 264
Lines 38899 38869 -30
Branches 8260 8254 -6
==========================================
+ Hits 12204 12248 +44
+ Misses 25457 25384 -73
+ Partials 1238 1237 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Hmm... not sure what that failing CESM system test is about. |
Contributor
Author
|
Very strange; it works on Derecho. Resubmitting. |
Contributor
Author
|
That did it! All tests have now passed. |
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.
Description
This changes
safe_copy(..., preserve_meta=False)to useshutil.copyfileinstead ofshutil.copywhensafe_copyis called on a file directly. This fixes the bug wherepreserve_meta=Falseincorrectly preserved permissions.The first set of test runs will fail because I'm pushing without the bugfix. Once those tests are complete, I'll push the fix and they should pass.
I added the tests in a new file, but they could be moved to test_unit_utils.py instead.
Checklist