DCWorkflow raises exception as a str

Bug #952301 reported by Alberto Lopes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope CMF buildout
New
Undecided
Unassigned

Bug Description

When trying to use DCWorkflow to set a new state variable for a workflow, I get the following traceback:

2012-03-11T11:47:39 ERROR Zope.SiteErrorLog 1331477259.770.659899943346 http://localhost:8080/Plone/portal_workflow/copy_of_simple_publication_workflow/variables/setStateVar
Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
  Module ZPublisher.Publish, line 46, in call_object
  Module Products.DCWorkflow.Variables, line 163, in setStateVar
  Module Products.DCWorkflow.Variables, line 152, in _checkId
  Module Products.DCWorkflow.ContainerTab, line 56, in _checkId
TypeError: exceptions must be old-style classes or derived from BaseException, not str

The offending code is found in ContainerTab.py:

(Pdb) l
 51 RESPONSE.redirect(self.absolute_url() + '/manage_main')
 52
 53 def _checkId(self, id, allow_dup=0):
 54 if not allow_dup:
 55 if self._mapping.has_key(id):
 56 -> raise 'Bad Request', 'The id "%s" is already in use.' %
id
 57 return Folder._checkId(self, id, allow_dup)
 58
 59 def _getOb(self, name, default=_marker):
 60 mapping = self._mapping
 61 if mapping.has_key(name):
(Pdb)

Version overview:

Plone 4.2b2 (4203)
CMF 2.2.5
Zope 2.13.12
Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)]
PIL 1.1.7

Revision history for this message
Alberto Lopes (plone-r) wrote :

Just for clarifying: I was trying to set a existing variable as the state variable. Setting a "new" variable (one not from the workflow variables list) works as expected.

The bug reported here is related to the raising of a (apparently) non-valid Exception.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.