Skip to content
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

shutil.SameFileError while copy slave files #1080

Closed
10 tasks
JiaZhou-PU opened this issue Oct 21, 2019 · 0 comments
Closed
10 tasks

shutil.SameFileError while copy slave files #1080

JiaZhou-PU opened this issue Oct 21, 2019 · 0 comments

Comments

@JiaZhou-PU
Copy link
Collaborator

JiaZhou-PU commented Oct 21, 2019


Defect Description

Describe the defect

What did you see instead?

shutil might have a SameFileError while specifying an absolute path of an input file for an inner run in RAVEN run RAVEN, this might be fixed if using perturbable='False' or using the relative path for input file, since any absolute path input file might not be perturbable.

This error is new in python 3

exception shutil.SameFileError
This exception is raised if source and destination in copyfile() are the same file.

New in version 3.4.
Do you have a suggested fix for the development team?

Change perturbable of any absolute file to be False, or add an exception for copy the same file.

Describe how to Reproduce

Traceback (most recent call last):
   File "/.conda/envs/raven_libraries/lib/python3.7/threading.py", line 926, in _bootstrap_inner
     self.run()
   File "/.conda/envs/raven_libraries/lib/python3.7/threading.py", line 870, in run
     self._target(*self._args, **self._kwargs)
   File "/home/zhoujia/projects/raven/framework/Runners/SharedMemoryRunner.py", line 136, in <lambda>
     self.thread = InterruptibleThread(target = lambda q, *arg : q.append(self.functionToRun(*arg)),
   File "/projects/raven/framework/Models/Code.py", line 479, in evaluateSample
     inputFiles = self.createNewInput(myInput, samplerType, **kwargs)
   File "/projects/raven/framework/Models/Code.py", line 383, in createNewInput
     newInput    = self.code.createNewInput(newInputSet,self.oriInputFiles,samplerType,**copy.deepcopy(kwargs))
   File "/projects/raven/framework/CodeInterfaces/RAVEN/RAVENInterface.py", line 268, in createNewInput
     parser.copySlaveFiles(currentInputFiles[index].getPath())
   File "/projects/raven/framework/CodeInterfaces/RAVEN/RAVENparser.py", line 177, in copySlaveFiles
     shutil.copy(slaveInputFullPath,slaveDir)
   File "/.conda/envs/raven_libraries/lib/python3.7/shutil.py", line 248, in copy
     copyfile(src, dst, follow_symlinks=follow_symlinks)
   File "/.conda/envs/raven_libraries/lib/python3.7/shutil.py", line 104, in copyfile
     raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
 shutil.SameFileError: '...' and '..' are the same file

For Change Control Board: Issue Review

This review should occur before any development is performed as a response to this issue.

  • 1. Is it tagged with a type: defect or task?
  • 2. Is it tagged with a priority: critical, normal or minor?
  • 3. If it will impact requirements or requirements tests, is it tagged with requirements?
  • 4. If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users.
  • 5. Is a rationale provided? (Such as explaining why the improvement is needed or why current code is wrong.)

For Change Control Board: Issue Closure

This review should occur when the issue is imminently going to be closed.

  • 1. If the issue is a defect, is the defect fixed?
  • 2. If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.)
  • 3. If the issue can impact users, has an email to the users group been written (the email should specify if the defect impacts stable or master)?
  • 4. If the issue is a defect, does it impact the latest release branch? If yes, is there any issue tagged with release (create if needed)?
  • 5. If the issue is being closed without a pull request, has an explanation of why it is being closed been provided?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant