Export to GitHub

json-template - issue #3

Template.expand does not accept an encoding paramter


Posted on Mar 30, 2009 by Massive Horse

What steps will reproduce the problem? 1. Run the simple example: jsontemplate.expand('Hello {name}', {'name': 'world'})

Results in: >>> jsontemplate.expand('Hello {name}', {'name': 'world'}) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "jsontemplate.py", line 658, in expand return t.expand(dictionary, encoding=encoding) TypeError: expand() got an unexpected keyword argument 'encoding'

The module method expand passes an encoding param to the Template.expand method, which does not define an encoding param in its signature.

What version of the product are you using? On what operating system? MacOSX / (FreeBSD-like) Python 2.5.1

Comment #1

Posted on Mar 30, 2009 by Quick Hippo

Sorry about that, just fixed it. I just removed the concept of encoding because it's unicode agnostic, and forgot to change that function.

(Now the template system does no encoding at all -- it returns unicode() or str() instances dependings on the types of input you give it, which I think is the right API)

Status: Fixed

Labels:
Type-Defect Priority-Medium