Edgewall Software

Ticket #44 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Error reporting fails in py:def when TypeError is raised

Reported by: oliver.cope@… Owned by: cmlenz
Priority: minor Milestone: 0.3
Component: Expression evaluation Version: 0.2
Keywords: Cc:

Description

TypeErrors are supressed when raised from within a py:def function.

Example:

>>>
>>> def badfunc():
...     raise TypeError
... 
>>> template = Template("""
...     <html xmlns:py="http://markup.edgewall.org/">
...     <div py:def="dobadfunc()">
...         ${badfunc()}       
...     </div>
...     <div py:content="dobadfunc()"/>
...     </html>
... """)
>>> print template.generate(badfunc=badfunc)
<html>
    <div><div>
        &lt;generator object at 0x833266c&gt;</div>
    </html>

I expected the TypeError to be propagated, as it is when called normally (ie not inside a py:def block).

Attachments

Change History

Changed 8 years ago by cmlenz

  • status changed from new to closed
  • resolution set to fixed

Should be fixed in [256].

Add/Change #44 (Error reporting fails in py:def when TypeError is raised)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.