Bad syntax in lib/python/DocumentTemplate/DT_In.py

Bug #267820 reported by Artur Zaprzała
4
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Medium
Tres Seaver
zope.documenttemplate
Fix Released
Medium
Tres Seaver

Bug Description

In sort_sequence() method there is a common bug in try...except statement. There is:
try: ... except AttributeError, KeyError: ...

but it should be:
try: ... except (AttributeError, KeyError): ...

The attached patch is also for lib/python/zope/documenttemplate/dt_in.py and replaces try...except statement with a simpler code.

Revision history for this message
Artur Zaprzała (arturz) wrote :
Revision history for this message
Tres Seaver (tseaver) wrote :

The first part of the patch applies to Zope2, but the second applies to the separately-releaesd (as of Zope 2.12) zope.documenttemplate.

Changed in zope2:
assignee: nobody → Tres Seaver (tseaver)
importance: Undecided → Medium
status: New → Confirmed
Changed in zope.documenttemplate:
assignee: nobody → Tres Seaver (tseaver)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Tres Seaver (tseaver) wrote :

Thanks for the patch. Now comitted to the Zope 2.12 branch:

  http://svn.zope.org/Zope/branches/2.12/?rev=112186&view=rev

and to the trunk:

  http://svn.zope.org/Zope/trunk/?rev=112187&view=rev

Changed in zope2:
status: Confirmed → Fix Committed
Tres Seaver (tseaver)
Changed in zope2:
milestone: none → 2.12.5
Changed in zope2:
milestone: 2.12.5 → 2.12.6
Tres Seaver (tseaver)
Changed in zope2:
status: Fix Committed → Fix Released
Tres Seaver (tseaver)
Changed in zope.documenttemplate:
status: Confirmed → Fix Released
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.