-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fixed local variable 'sec' referenced before assignment error #23
Conversation
When a file cannot be loaded (e.g., removed from disk) then multivolume importer plugin failed with this error: [DEBUG][Qt] 02.10.2017 23:22:13 [] (unknown:0) - Could not load "C:/Users/msliv/Downloads/dicom4miccai/DICOM4MICCAI-Data/QIN-HEADNECK-01-0024-PET/1.2.276.0.7230010.3.1.4.1334872705.15988.1505074246.702.dcm" DCMTK says: No such file or directory [DEBUG][Qt] 02.10.2017 23:22:13 [] (unknown:0) - SQL failed Bad SQL: INSERT OR REPLACE INTO TagCache VALUES(?,?,?) [DEBUG][Qt] 02.10.2017 23:22:13 [] (unknown:0) - Error text: attempt to write a readonly database Unable to fetch row [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - Traceback (most recent call last): [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - File "C:\D\S4R\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 718, in getLoadablesFromFileLists [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - loadablesByPlugin[plugin] = plugin.examine(fileLists) [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - File "C:/D/S4R/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 80, in examine [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - loadables += self.examineFiles(files) [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - File "C:/D/S4R/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 430, in examineFiles [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - mvNodes = self.initMultiVolumes(subseriesLists[key]) [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - File "C:/D/S4R/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 646, in initMultiVolumes [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - tagValue = self.tm2ms(tagValueStr) # convert to ms [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - File "C:/D/S4R/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 615, in tm2ms [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - sec = sec+ssfrac [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - UnboundLocalError: local variable 'sec' referenced before assignment [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - Warning: Plugin failed: MultiVolumeImporterPlugin [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - [CRITICAL][Stream] 02.10.2017 23:22:13 [] (unknown:0) - See python console for error message. [INFO][Stream] 02.10.2017 23:22:23 [] (unknown:0) - DICOM Plugin failed: local variable 'sec' referenced before assignment
xref: commontk/CTK#749 I guess this will be irrelevant once commontk/CTK#750 is merged? @lassoan let me know if you still want to merge it. |
References: * commontk/CTK#751 * fedorov/MultiVolumeImporter#23 List of changes: ``` $ git shortlog a83cec9..f096a15 --no-merges Isaiah Norton (1): BUG: preserve whitespace in console completion Steve Pieper (1): BUG: consistent return for value of uninitialized data ``` git-svn-id: http://svn.slicer.org/Slicer4/trunk@26416 3bd1e089-480b-0410-8dfb-8563597acbee
For reference, as of Slicer r26416, commontk/CTK#750 has been integrated. |
It should not be necessary to merge it. Let's confirm that by testing the tomorrow's nightly build. |
@lassoan sounds good. Although, I think there may be some more deep underlying issue, which in my experience is not reproducible. I experienced this error several times (over months of time) with QuantitativeReporting, and was always unsuccessful trying to reproduce it after restarting Slicer. |
There have been some fixes in DICOM database connection handling in Slicer, so this problem might have been fixed. |
I see - glad there is an explanation for it in your case! |
References: * commontk/CTK#751 * fedorov/MultiVolumeImporter#23 List of changes: ``` $ git shortlog a83cec9..f096a15 --no-merges Isaiah Norton (1): BUG: preserve whitespace in console completion Steve Pieper (1): BUG: consistent return for value of uninitialized data ``` git-svn-id: http://svn.slicer.org/Slicer4/trunk@26416 3bd1e089-480b-0410-8dfb-8563597acbee
This is not needed anymore. |
When a file cannot be loaded (e.g., removed from disk) then multivolume importer plugin failed with this error: