diff --git a/src/djlint/__init__.py b/src/djlint/__init__.py index 8c27808..4a5abcc 100644 --- a/src/djlint/__init__.py +++ b/src/djlint/__init__.py @@ -228,7 +228,8 @@ def main( if temp_file and (config.reformat or config.check): # if using stdin, only give back formatted code. - echo(Path(temp_file.name).read_text(encoding="utf8").rstrip()) + echo(Path(temp_file.name).read_text(encoding="utf8").rstrip().encode('utf8')) + if temp_file: temp_file.close()