1#!/usr/bin/env python2 3import sys4 5getattr(sys.stdout, "buffer", sys.stdout).write(b"a line with bad encoding: \xc2.")6sys.stdout.flush()7