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

Opened 9 years ago

Last modified 9 years ago

[PATCH] tg.util get_partial_dict() doesn't work correctly.

Reported by: Tomoyuki Kano Owned by:
Priority: high Milestone: 2.1b1
Component: TurboGears Version: 2.1
Severity: critical Keywords:
Cc:

Description

here is a miss understanding of string.lstrip().

>>> from tg.util import get_partial_dict
>>> get_partial_dict('pre', {'pre.xyz':1, 'pre.pxy': 2, 'pre.erpzyx': 4, 'xy': 3})
{'xyz': 1, 'xy': 2, 'zyx': 4}
>>>

Attachments

tg.util.patch Download (421 bytes) - added by Tomoyuki Kano 9 years ago.

Change History

Changed 9 years ago by Tomoyuki Kano

comment:1 Changed 9 years ago by lmacken

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

I added a unit test that reproduces the bug:  http://bitbucket.org/turbogears/tg-dev/changeset/ebea49e8818a and I applied your fix in:  http://bitbucket.org/turbogears/tg-dev/changeset/d682e882969c

Thanks for the patch, Tomoyuki!

comment:2 Changed 9 years ago by chrisz

  • Milestone changed from __unclassified__ to 2.1b1
Note: See TracTickets for help on using tickets.