template.py does not understand unicode literals
Bug #120644 reported by
Anand Chitipothu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
web.py |
Fix Released
|
Undecided
|
Anand Chitipothu |
Bug Description
The following test fails because template.py does not understand unicode literals.
lambda: t(u'$def with (f)\n$f(
And here is the fix.
def h_literal(self, i):
item = i[THING]
- if isinstance(item, str) and item[0] in ['"', "'"]:
+ if isinstance(item, (str, unicode)) and item[0] in ['"', "'"]:
item = item[1:-1]
elif isinstance(item, (float, int)):
pass
Changed in webpy: | |
status: | New → Fix Committed |
Changed in webpy: | |
assignee: | nobody → anandology |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Actually, instead of `(str, unicode)`, you can just use `basestring`. That's what it's for.
And it might be a few milliseconds faster. :)