Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2444 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

TG 2.1a3 dispatcher mistakenly assumes all required positional parameters are provided

Reported by: mcfletch Owned by:
Priority: normal Milestone: 2.1b1
Component: TurboGears Version: 2.1a3
Severity: normal Keywords:


At line 145 of dispatcher.py, the code makes the assumption that it can do remainder[i]. If the user provides 1 parameter positionally (i.e. as part of the URL) and the next via keyword argument, the handler raises an exception trying to assign remainder[i]... fix:

for i,var in enumerate(required_vars):

if i < len(remainder):

remainder[i] = params[var] del params[var]

that is, check for i< len(remainder) before attempting to assign to it.

Change History

comment:1 Changed 9 years ago by percious

did you try tip?

I just fixed this mess.

comment:2 Changed 9 years ago by mcfletch

Sorry, didn't try tip, am in the middle of porting a project for PyCon? and was just wanting to make sure this didn't get lost in the meantime. If it's already fixed, please feel free to close this.

comment:3 Changed 9 years ago by mcfletch

There was still a bug in tip for the handling of positional parameters with defaults. Pull  http://bitbucket.org/mcfletch/tg-dev/ to get the fix, test, etc.

comment:4 Changed 9 years ago by percious

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from __unclassified__ to 2.1b1
Note: See TracTickets for help on using tickets.