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

Opened 10 years ago

Last modified 9 years ago

TG 2.1a2 Routing Bug

Reported by: rpetrello Owned by:
Priority: normal Milestone: 2.1b1
Component: TurboGears Version: 2.1a3
Severity: major Keywords:
Cc: development@…

Description

I'm Ryan, one of the developers for ShootQ.com. We're experiencing a bug in TG2.1a2 (and possible TG2.1a3, unless it's been identified and resolved) routing that is presenting problems for our current migration from TG 1.9.7a4. I've attached a TG 2.1a2 quickstart project that illustrates a sample URL structure that suffers from the bug. To reproduce the bug, start the quickstart project, navigate to localhost:8080, and follow the instructions.

Thanks!

Attachments

TG2Bug.zip Download (132.8 KB) - added by rpetrello 10 years ago.
tg_positional_args.diff Download (1.7 KB) - added by rpetrello 10 years ago.
tg_routing_issues.diff Download (1.9 KB) - added by rpetrello 10 years ago.
TG2Bug2.zip Download (164.1 KB) - added by rpetrello 10 years ago.

Change History

Changed 10 years ago by rpetrello

comment:1 Changed 10 years ago by rpetrello

  • Severity changed from normal to major

This seems to be caused when removing parameters from the argument list that aren't named parameters during routing. Sometimes the passed remainder is a tuple. Line 142, specifically, is attempting item assignment and failing:

Module tg.controllers.dispatcher:237 in _perform_call
>>  r = self._call(func, params, remainder=remainder)
Module tg.controllers.dispatcher:142 in _remove_argspec_params_from_params
>>  remainder[i] = params[var]
TypeError: 'tuple' object does not support item assignment

i	        0
params	        {'movieID': '1', 'type': u'drama'}
remainder	('1',)

comment:2 Changed 10 years ago by rpetrello

  • Version changed from 2.1a2 to 2.1a3

We're also experiencing this bug in 2.1a3.

Changed 10 years ago by rpetrello

comment:3 Changed 10 years ago by rpetrello

Attached a patch. I'm sure the tuple > list conversion should be applied somewhere higher in the dispatch stack, though I'm not quite sure where. Feedback is welcome. For now, this resolves the bug I'm experiencing in TG 2.1a2/3.

comment:4 Changed 10 years ago by percious

Yeah, I've suspected this bug for a while, in fact I think there are a couple of tickets for it now, i'll go track them down when I get a chance. I'll make sure this makes it to b1, sometime in early jan i'll release that.

comment:5 Changed 10 years ago by rpetrello

  • Milestone changed from __unclassified__ to 2.* bugfix

In testing, we've stumbled upon another (very closely related) routing bug. I've attached another TG 2.1a3 quickstart project that illustrates a sample URL structure that suffers from the bug. To reproduce the bug, start the quickstart project, navigate to localhost:8080, and follow the instructions. Additionally, I've attached another patch which solves both of the aforementioned routing issues.

Changed 10 years ago by rpetrello

Changed 10 years ago by rpetrello

comment:6 Changed 9 years ago by percious

  • Milestone changed from 2.* bugfix to 2.1b1

comment:7 Changed 9 years ago by percious

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