terrapower / armi

An open-source nuclear reactor analysis automation framework that helps design teams increase efficiency and quality
https://terrapower.github.io/armi/
Apache License 2.0
214 stars 82 forks source link

Fix `safeCopy` to work on Linux #1691

Closed opotowsky closed 2 months ago

opotowsky commented 2 months ago

What is the change?

Replace shutil.copyfile and shutil.copymode with a copy (windows) or cp (linux) command. This accomplishes the same thing as before (file copy with metadata).

We are NOT taking away the fact that safeCopy overrides shutil.copy in this PR, because there are significant downstream impacts and we need to check in with other ARMI users first. That is being tracked in the ticket #1690.

Why is the change being made?

Depending on how permissions are set up, this doesn't work on all linux systems.


Checklist

opotowsky commented 2 months ago

More internal testing/processes are needed before this can be merged, but it's ready for a review, at least

john-science commented 2 months ago

Yeah, let's remove the possible infinite loop of "while True" here and set a time for... I don't know, 30 or 60 minutes.