Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Worked around a Python 2.6 bug whereby file streams don't respect encoding #262
After many hours of trying to find the best way to solve this problem, here's my solution. It ensures that Python 2.6 file streams will always encode to bytes before writing to the output stream. This works around Python issue 4947.
You may reproduce the original problem as follows with Python 2.6:
# encoding: utf-8 from invoke import task, run @task def output_strange_stuff(): print '└──' @task def breakit(): run('invoke output_strange_stuff', encoding='utf-8')
Feel free to ask any questions and thanks for the amazing tool!