Files
Chris Dent c697b533e0 Unicode content from disk must become bytes
While trying to figure out some tests for the fix in #203 it became
clear that the handling of encoded-on-disk-but-textual content
when using <@ to load content was not sufficiently robust in both
python 2 and 3.

We want to load content to become unicode so that it is used
internally correctly, for example in the replace_template handling
used for substitutions, but when an HTTP request is made the content
must become whatever the versioned equivalent of bytes is.

Therefore the code has been changed to load non_binary content and
decode it to six.text_type, do replace_template on it, and then turn
the body, if it is not already bytes, into bytes.

This is verified by adjusting data.json to have some utf8 in it and
adding and loading a utf8.txt example file.
2017-02-16 17:21:54 +00:00

2 lines
21 B
JSON

{"foo": {"bár": 1}}