cutright / DVH-Analytics

A DICOM Database Application for Radiation Oncology
Other
82 stars 30 forks source link

shutil.copy may cause DVHA crash if dest file path already exists #103

Closed cutright closed 3 years ago

cutright commented 3 years ago

Issue is so far only observed on MSW7 with python 3.7. When importing a file set that has been previously imported, but deleted from DB such that the files remained in the imported directory, DVHA may crash after copying the files. Issue has been isolated to shutil.copy below:

https://github.com/cutright/DVH-Analytics/blob/993f5510dd8ebeacebda2238befa11c80055c007/dvha/tools/utilities.py#L399

cutright commented 3 years ago

shutil.move can cause crash as well.

"Fixed" in v0.8.8. I'm going to favor the following known issue over having DVHA crash:

If importing a DICOM file with a file name and matching PatientID (i.e., MRN) that already exists in DVHA's imported directory, the previously existing file will remain. If "Leave file in inbox" is not checked, the original file will be deleted rather than moved.