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 #2425 (closed defect: fixed)

Opened 10 years ago

Last modified 9 years ago

TG 2.1 dispatch arg-value errors

Reported by: seedifferently Owned by: percious
Priority: normal Milestone: 2.1b1
Component: TurboGears Version: trunk
Severity: critical Keywords:
Cc:

Description

I know a lot of work has gone into dispatch in v2.1 (thanks Chris!), but controller methods like this are breaking my apps on an upgrade from 2.0 to 2.1alpha:

    @expose()
    def test(self, id, one=None, two=2, three=3):
        return 'test'

Go to  http://127.0.0.1:8080/test/1 and you will get:

File '/[...]/TG21/lib/python2.5/site-packages/TurboGears2-2.1a3-py2.5.egg/tg/controllers/dispatcher.py', line 142 in _remove_argspec_params_from_params
  remainder[i] = params[var]
KeyError: 'one'

Change History

comment:1 Changed 9 years ago by percious

  • Status changed from new to assigned
  • Owner set to percious
  • Severity changed from major to critical
  • Milestone changed from __unclassified__ to 2.1b1

comment:2 Changed 9 years ago by percious

I added a test for this exact use case today and find it to be working. can you test this on tip?

comment:3 Changed 9 years ago by percious

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

comment:4 Changed 9 years ago by seedifferently

  • Status changed from closed to reopened
  • Resolution fixed deleted

Chris,

Just tested this with today's tip and am still getting a key error. Did you try pasting my sample code inside a controller somewhere? Perhaps your test case is checking for something different.

Thanks, Seth

comment:5 Changed 9 years ago by percious

here is the changeset that shows the tests I added to prove this works.  http://bitbucket.org/turbogears/tg-dev/changeset/7645cc21b1dd/

please be certain that you are running tip when you test that this is non-functional. Perhaps you are running this code inside a RestController??

cheers. -chris

comment:6 Changed 9 years ago by percious

You know, i've only tested this on 2.6 i think, i wonder if 2.5 has different behavior.

comment:7 Changed 9 years ago by percious

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

comment:8 Changed 9 years ago by seedifferently

Yep, working perfectly on the latest tip! Thanks so much.

Note: See TracTickets for help on using tickets.