named=True raises "unexpected argument" for Engine events

Issue #3201 duplicate
Elmer de Looff created an issue

The events documentation notes that since 0.9, the listens_for event decorator accepts a keyword named. With this, event arguments are provided as a dict. This works fine for the example of the Pool event, but fails for Engine events (for the current 0.9.7 release).

A testcase to reproduce this and traceback are included as attachments. The relevant code is also included below:

from sqlalchemy.event import listens_for
from sqlalchemy.engine import Engine

@listens_for(Engine, 'before_execute', named=True)
def intercept_execute(conn, **kw):
    print conn.engine.url

Comments (4)

  1. Elmer de Looff reporter

    Heh, I swear I used the search for this. Bitbucket does not want to play ball when you use more than one search term it seems.. "named events" comes up empty. Certainly similar enough to be a duplicate.

  2. Log in to comment