If one uses --output -, the current ashes code uses print(output_text) which writes the representation of the bytes in Python syntax (i.e. b'<...\t\t...') as opposed to the actual text.
Instead of print(output_text) one could use sys.stdout.write(output_bytes).
The following simple patch solves this issue:
@@ -2664,21 +2664,21 @@ def _simple_render(template_path, template_literal, env_path_list,
raise CLIError('expected model or model literal')
elif model_path == '-':
model = json.load(sys.stdin)
else:
with open(model_path) as f:
model = json.load(f)
output_text = tmpl_obj.render(model)
output_bytes = output_text.encode(output_encoding)
if output_path == '-':
- print(output_bytes)
+ sys.stdout.write(output_text)
else:
with open(output_path, 'wb') as f:
f.write(output_bytes)
return
def main():
# using optparse for backwards compat with 2.6 (and earlier, maybe)
from optparse import OptionParser
If one uses
--output -, the current ashes code usesprint(output_text)which writes the representation of the bytes in Python syntax (i.e.b'<...\t\t...') as opposed to the actual text.Instead of
print(output_text)one could usesys.stdout.write(output_bytes).The following simple patch solves this issue: