Opened 14 years ago

Closed 13 years ago

#992 defect closed fixed (fixed)

session.getComponent doesn't work with 'default' keyword arg

Reported by: justinj Owned by:
Priority: highest Milestone:
Component: core Keywords:
Cc: itamarst, justinj, jknight Branch:


Change History (8)

comment:1 Changed 14 years ago by justinj

After upgrading to Twisted 2.0 on Windows 2000, and changing code to use 
zope.interface, lines like following never pick up passed in default value.

thing = session.getComponent(IThing, default="blah")

Instead, thing is set to None.  Removing default= so that the default is just 
passed in as the 2nd arg fixes the problem.  Heard on irc that default keyword 
arg shouldn't be used anymore because zope doesn't support it.  I didn't see 
any doc on this anywhere, so I'm assuming it's a bug.

comment:2 Changed 14 years ago by jknight

Agree, looks like a bug in Componentized.getComponent. => itamarst.

comment:3 Changed 13 years ago by Jean-Paul Calderone

Component: core
Keywords: review added
Owner: itamarst deleted
Priority: highhighest

Fixed in getcomponent-992. Please review.

comment:4 Changed 13 years ago by Jean-Paul Calderone

Owner: set to David Reid

comment:5 Changed 13 years ago by David Reid

Keywords: review removed
Status: newassigned

comment:6 Changed 13 years ago by David Reid

Owner: changed from David Reid to Jean-Paul Calderone
Status: assignednew

There isn't anything bad to note about this branch. The change is simple and functional and the tests pass. Ok to merge.

comment:7 Changed 13 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [18897]) Merge getcomponent-992

Author: exarkun Reviewer: dreid Fixes #992

Add tests for twisted.python.components.Componentized.getComponent's default argument and fix a bug which caused it to always be ignored.

comment:8 Changed 8 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.