# HG changeset patch # User hodgestar # Date 1286747649 0 # Node ID c34c3c78eb3dd604f4fd946782dd145b82fa5993 # Parent 493e1ea770f067a4e8a5c9a80c3641f653e0573e Allow missing encoding attribute on sys.stdout in case stdout has been replaced by, for example, a StringIO object (as is the case under nosetests). diff --git a/bitten/build/api.py b/bitten/build/api.py --- a/bitten/build/api.py +++ b/bitten/build/api.py @@ -44,7 +44,7 @@ try: return text.decode('utf-8') except UnicodeDecodeError: - return text.decode(sys.stdout.encoding, 'replace') + return text.decode(getattr(sys.stdout, 'encoding', 'utf-8'), 'replace') class CommandLine(object):