Merge lp:~max-rabkin/ibid/factoid-542707 into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Max Rabkin
Status: Merged
Approved by: Stefano Rivera
Approved revision: 926
Merged at revision: 920
Proposed branch: lp:~max-rabkin/ibid/factoid-542707
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 16 lines (+2/-1)
1 file modified
ibid/plugins/factoid.py (+2/-1)
To merge this branch: bzr merge lp:~max-rabkin/ibid/factoid-542707
Reviewer Review Type Date Requested Status
marcog (community) Approve
Stefano Rivera Approve
Michael Gorven Approve
Review via email: mp+22170@code.launchpad.net

Commit message

Use re.UNICODE when substituting arguments in factoid responses

To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve
Revision history for this message
Stefano Rivera (stefanor) wrote :

Obviously this needs to be done in many more places. I'd prefer a full code audit, but this does fix the bug.

review: Approve
Revision history for this message
marcog (marco-gallotta) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/factoid.py'
2--- ibid/plugins/factoid.py 2010-02-24 12:42:45 +0000
3+++ ibid/plugins/factoid.py 2010-03-25 19:40:31 +0000
4@@ -484,8 +484,9 @@
5 reply = fvalue.value
6 oname = fname.name
7 pattern = re.escape(fname.name).replace(r'\$arg', '(.*)')
8+ args = re.match(pattern, name, re.I | re.U).groups()
9
10- for i, capture in enumerate(re.match(pattern, name, re.I).groups()):
11+ for i, capture in enumerate(args):
12 reply = reply.replace('$%s' % (i + 1), capture)
13 oname = oname.replace('$arg', capture, 1)
14
15
16=== modified file 'ibid/plugins/geography.py'

Subscribers

People subscribed via source and target branches