problem:
When using a number as a param value in a str_replace function within a hot template, an exception is thrown.
expected:
When using a number as a param value in the str_replace function, hot should handle the conversion to a string gracefully.
actual:
If you try to use a number as a parameter value to str_replace the following exception is thrown:
Traceback (most recent call last):
File "heat/tests/test_hot.py", line 190, in test_str_replace_number
tmpl.resolve_replace(snippet))
File "heat/engine/hot.py", line 256, in resolve_replace
handle_str_replace, s)
File "heat/engine/template.py", line 485, in _resolve
return handle(recurse(v))
File "heat/engine/hot.py", line 251, in handle_str_replace
text = text.replace(key, value)
TypeError: expected a character buffer object
problem:
When using a number as a param value in a str_replace function within a hot template, an exception is thrown.
expected:
When using a number as a param value in the str_replace function, hot should handle the conversion to a string gracefully.
actual:
If you try to use a number as a parameter value to str_replace the following exception is thrown:
Traceback (most recent call last): test_hot. py", line 190, in test_str_ replace_ number resolve_ replace( snippet) ) hot.py" , line 256, in resolve_replace str_replace, s) template. py", line 485, in _resolve hot.py" , line 251, in handle_str_replace
File "heat/tests/
tmpl.
File "heat/engine/
handle_
File "heat/engine/
return handle(recurse(v))
File "heat/engine/
text = text.replace(key, value)
TypeError: expected a character buffer object
Template snippet that would cause this bug:
str_replace:
#! /bin/bash -v
./ script/ rails server -p %http_port% -d
"% http_port% ": 80
template: |
...
params: