Opened 10 years ago

Closed 8 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:
Author: Launchpad Bug:

Description


Change History (8)

comment:1 Changed 10 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 10 years ago by jknight

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

comment:3 Changed 8 years ago by exarkun

  • Component set to core
  • Keywords review added
  • Owner itamarst deleted
  • Priority changed from high to highest

Fixed in getcomponent-992. Please review.

comment:4 Changed 8 years ago by exarkun

  • Owner set to dreid

comment:5 Changed 8 years ago by dreid

  • Keywords review removed
  • Status changed from new to assigned

comment:6 Changed 8 years ago by dreid

  • Owner changed from dreid to exarkun
  • Status changed from assigned to new

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 8 years ago by exarkun

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by <automation>

  • Owner exarkun deleted
Note: See TracTickets for help on using tickets.