View Issue Details

IDProjectCategoryView StatusLast Update
0003871Slicer4Core: Scripting (Wrapping, Python)public2020-03-04 12:02
Reporterpinter Assigned Tojcfr  
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionunable to reproduce 
Product VersionSlicer 4.3.1-2 
Target VersionFixed in Version 
Summary0003871: Python error logged for scripted modules that do not have FileIO
Description

the following error is logged onto the python prompt for many scripted modules (AtlasTests, Charting, etc.):
"qSlicerScriptedFileWriter::setPythonSource - Failed to load scripted file writer: class %1 was not found in file %2"
but somehow these messages don't appear. It is done in qSlicerScriptedFileWriter::setPythonSource.

className in these cases is always empty, because it is called with an empty argument for className (see call stack below) from the function qSlicerScriptedLoadableModule::registerIO() like this:
bool ret = fileWriter->setPythonSource(d->PythonSource);

It appears for me if I add a setup() method in the python class of a scripted module, in my case the DICOM module. I worked around it by adding a dummy class DICOMFileWriter.

Probably we shouldn't log an error if a scripted module doesn't have FileIO capabilities, as it is not an expectation. Also it is strange that the error is logged but doesn't appear. Maybe the interactor is not fully initialized yet?

Additional Information

Call stack:

qSlicerBaseQTCore.dll!qSlicerScriptedFileWriter::setPythonSource(const QString & newPythonSource={...}, const QString & className={...}) Line 161 C++
qSlicerBaseQTGUI.dll!qSlicerScriptedLoadableModule::registerIO() Line 292 + 0x45 bytes C++
qSlicerBaseQTGUI.dll!qSlicerScriptedLoadableModule::setup() Line 263 C++
qSlicerBaseQTCore.dll!qSlicerAbstractCoreModule::initialize(vtkSlicerApplicationLogic _appLogic=0x00000000046df8e0) Line 99 C++
qSlicerBaseQTCore.dll!qSlicerModuleFactoryManager::loadModule(const QString & name={...}, const QString & dependee={...}) Line 173 C++
qSlicerBaseQTCore.dll!qSlicerModuleFactoryManager::loadModule(const QString & name={...}) Line 110 + 0x2e bytes C++
SlicerApp-real.exe!`anonymous namespace'::SlicerAppMain(int argc=3, char
* argv=0x00000000046b1fe0) Line 182 + 0x16 bytes C++

TagsNo tags attached.

Activities

pinter

pinter

2014-10-10 06:33

developer   ~0012610

Discussion: http://slicer-devel.65872.n3.nabble.com/Python-error-for-lot-of-scripted-modules-td4032664.html

lassoan

lassoan

2020-03-04 12:02

developer   ~0016331

Not reproducible anymore in recent releases (tested in Slicer-4.11.0-2020-03-01 - revision 28798).

Issue History

Date Modified Username Field Change
2014-10-10 06:33 pinter New Issue
2014-10-10 06:33 pinter Status new => assigned
2014-10-10 06:33 pinter Assigned To => jcfr
2014-10-10 06:33 pinter Note Added: 0012610
2020-03-04 12:02 lassoan Status assigned => closed
2020-03-04 12:02 lassoan Resolution open => unable to reproduce
2020-03-04 12:02 lassoan Note Added: 0016331