python redirect both stdout and stderr to file