funny bug: a tool with a variable named "type" causes exception in workflows
Hi, I have a tool which have a variable named "type" (see example XML file below). This tool works fine when running it manually, but when adding this tool to a workflow *and* changing the default options from "typeA" to "typeB" - an exception is thrown when trying to save the workflow, and the "saving workflow" progress bar hangs forever. XML: ========================== <tool id="dummy_tool" name="Test tool"> <description>with a variable named 'type'</description> <command>echo $type > '$output'</command> <inputs> <param name="type" type="select" label="Type variable"> <option value="typeA">Type A</option> <option value="typeB">Type B</option> <option value="typeC">Type C</option> </param> </inputs> <outputs> <data format="txt" name="output" /> </outputs> </tool> ========================== The exception: ===== URL: http://tango.cshl.edu/galaxy/workflow/editor_form_post File '/home/gordon/projects/galaxy_devel/eggs/WebError-0.8a-py2.5.egg/weberror/evalexception/middleware.py', line 364 in respond app_iter = self.application(environ, detect_start_response) File '/home/gordon/projects/galaxy_devel/eggs/Paste-1.6-py2.5.egg/paste/debug/prints.py', line 98 in __call__ environ, self.app) File '/home/gordon/projects/galaxy_devel/eggs/Paste-1.6-py2.5.egg/paste/wsgilib.py', line 539 in intercept_output app_iter = application(environ, replacement_start_response) File '/home/gordon/projects/galaxy_devel/eggs/Paste-1.6-py2.5.egg/paste/recursive.py', line 80 in __call__ return self.application(environ, start_response) File '/home/gordon/projects/galaxy_devel/lib/galaxy/web/framework/middleware/remoteuser.py', line 103 in __call__ return self.app( environ, start_response ) File '/home/gordon/projects/galaxy_devel/eggs/Paste-1.6-py2.5.egg/paste/httpexceptions.py', line 632 in __call__ return self.application(environ, start_response) File '/home/gordon/projects/galaxy_devel/lib/galaxy/web/framework/base.py', line 125 in __call__ body = method( trans, **kwargs ) File '/home/gordon/projects/galaxy_devel/lib/galaxy/web/framework/__init__.py', line 62 in decorator return simplejson.dumps( func( self, trans, *args, **kwargs ) ) File '/home/gordon/projects/galaxy_devel/lib/galaxy/web/controllers/workflow.py', line 519 in editor_form_post 'tool_state': incoming.pop("tool_state") File '/home/gordon/projects/galaxy_devel/lib/galaxy/workflow/modules.py', line 286 in from_dict assert type in self.module_types AssertionError: ===== It seems like somehow the tool variable "type" overwrote the value of the python variable 'type' in that module (see attached screenshot). Maybe there is such a thing as 'too much' of a dynamic language ;) The obvious workaround is not to name my XML variables with a name that might conflict with galaxy's internals. -gordon P.S. My galaxy version is based on 3545:2590120aed68 .
participants (1)
-
Assaf Gordon